瀏覽代碼

scripts/scope checkers: reduce false negatives

tbjump 2 年之前
父節點
當前提交
db0c1193e0
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      scripts/check-docker-pin.sh
  2. 1 1
      scripts/check-npm-package-scopes.sh

+ 1 - 1
scripts/check-docker-pin.sh

@@ -13,7 +13,7 @@
 #   - We ignore cosmwasm_artifacts AS artifacts because it's a local reference only, is built in tilt
 #   - We ignore base AS (ignite-go-build|ignite-vue-build) because the base image is already pinned in wormchain/Dockerfile.proto
 #
-git ls-files | grep "Dockerfile*" | xargs grep -s "FROM" | egrep -v 'sha256|scratch|solana|aptos|sui|base|cosmwasm_artifacts AS (application|base|builder|ci_tests|tests|artifacts|ignite-go-build|ignite-vue-build)'
+git ls-files -z | grep -z "Dockerfile*" | xargs -r -0 grep -s "FROM" | egrep -v 'sha256|scratch|solana|aptos|sui|base|cosmwasm_artifacts AS (application|base|builder|ci_tests|tests|artifacts|ignite-go-build|ignite-vue-build)'
 if [ $? -eq 0 ]; then
    echo "[!] Unpinned docker files" >&2
    exit 1

+ 1 - 1
scripts/check-npm-package-scopes.sh

@@ -2,7 +2,7 @@
 
 # This script checks to ensure that all our NPM packages have an appropriate scope.
 #
-git ls-files | grep "package.json" | xargs grep -s "\"name\":" | egrep -v '@certusone/|@wormhole-foundation/'
+git ls-files -z | grep -z "package.json" | xargs -n1 -r -0 /bin/bash -c 'printf "[$@]"; jq  ".name" "$@";' '' | egrep -v "^\[.*\]null$" | egrep -v '^\[.*\]"(@certusone/|@wormhole-foundation/)'
 if [ $? -eq 0 ]; then
    echo "[!] Unscoped npm packages" >&2
    exit 1