Skip to content

Commit

Permalink
Go 1.17 prep - ignore vendor directory in staticcheck (#3114)
Browse files Browse the repository at this point in the history
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 <enyeart@us.ibm.com>
  • Loading branch information
denyeart authored Dec 13, 2021
1 parent 0b0c35c commit 1f1d666
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/golinter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1f1d666

Please sign in to comment.