From c0371da8c004bc1c9137c1f134b0f47666c8834b Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 7 Jun 2023 18:43:16 +0800 Subject: [PATCH] fix lint --- .golangci.yml | 12 ++++++------ scripts/protocgen.sh | 10 ++++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 2c49774965..d1aa62dfe1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -66,9 +66,9 @@ linters-settings: gomodguard: blocked: versions: # List of blocked module version constraints - - https://github.com/etcd-io/etcd: # Blocked module with version constraint - version: ">= 3.4.10 || ~3.3.23" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons - reason: "CVE-2020-15114; CVE-2020-15136; CVE-2020-15115" # Reason why the version constraint exists. (Optional) - - https://github.com/dgrijalva/jwt-go: # Blocked module with version constraint - version: ">= 4.0.0-preview1" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons - reason: "CVE-2020-26160" # Reason why the version constraint exists. (Optional) + - https://github.com/etcd-io/etcd: # Blocked module with version constraint + version: ">= 3.4.10 || ~3.3.23" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons + reason: "CVE-2020-15114; CVE-2020-15136; CVE-2020-15115" # Reason why the version constraint exists. (Optional) + - https://github.com/dgrijalva/jwt-go: # Blocked module with version constraint + version: ">= 4.0.0-preview1" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons + reason: "CVE-2020-26160" # Reason why the version constraint exists. (Optional) diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index d6ab74ec4a..bbdb995018 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -4,14 +4,16 @@ # Commands to run locally # docker run --network host --rm -v $(CURDIR):/workspace --workdir /workspace tendermintdev/sdk-proto-gen:v0.7 sh ./protocgen.sh # -set -e +set -eo pipefail echo "Generating gogo proto code" -proto_dirs=$(find ./ -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) +proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) for dir in $proto_dirs; do - for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do + proto_files=$(find "${dir}" -maxdepth 1 -name '*.proto') + for file in $proto_files; do + # Check if the go_package in the file is pointing to evmos if grep -q "option go_package.*ethermint" "$file"; then - buf generate --template proto/buf.gen.gogo.yaml $file + buf generate --template proto/buf.gen.gogo.yaml "$file" fi done done