From 1f1d6669e917fe1b431c32582372281b5c878150 Mon Sep 17 00:00:00 2001 From: Dave Enyeart Date: Mon, 13 Dec 2021 10:29:12 -0500 Subject: [PATCH] Go 1.17 prep - ignore vendor directory in staticcheck (#3114) A few vendored dependencies have benign staticcheck errors when using Go 1.17. This commit simply filters out vendor directories in staticcheck output since the intention of the linter is to check Fabric source only. Note - it is not possible to filter the vendor directories as input to staticcheck, as they will still show up when the Fabric package that uses them gets checked. Have to filter the output instead. Signed-off-by: David Enyeart --- scripts/golinter.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/golinter.sh b/scripts/golinter.sh index 6177926ae3d..438e3a3c764 100755 --- a/scripts/golinter.sh +++ b/scripts/golinter.sh @@ -69,8 +69,9 @@ if [ -n "$OUTPUT" ]; then exit 1 fi +# staticcheck Fabric source files - ignore issues in vendored dependency projects echo "Checking with staticcheck" -OUTPUT="$(staticcheck ./... || true)" +OUTPUT="$(staticcheck ./... | grep -v vendor/ || true)" if [ -n "$OUTPUT" ]; then echo "The following staticcheck issues were flagged" echo "$OUTPUT"