Skip to content

Commit

Permalink
Fix shellcheck warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Felixoid committed Jul 29, 2021
1 parent 31bc1ac commit 3893fa7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ if [ -z ${PKG+x} ]; then echo "PKG is not set"; exit 1; fi
if [ -z ${ROOT_DIR+x} ]; then echo "ROOT_DIR is not set"; exit 1; fi

echo "gofmt:"
OUT=$(gofmt -l -s $ROOT_DIR 2>&1 | grep --invert-match -E "(/(example|vendor))")
OUT=$(gofmt -l -s "$ROOT_DIR" 2>&1 | grep --invert-match -E "(/(example|vendor))")
if [ -n "$OUT" ]; then echo "$OUT"; PROBLEM=1; fi

echo "errcheck:"
OUT=$(errcheck $PKG/... 2>&1 | grep --invert-match -E "(/(example|vendor))")
OUT=$(errcheck "$PKG/..." 2>&1 | grep --invert-match -E "(/(example|vendor))")
if [ -n "$OUT" ]; then echo "$OUT"; PROBLEM=1; fi

echo "go vet:"
OUT=$(go vet -all=true $ROOT_DIR 2>&1 | grep --invert-match -E "(Checking file|\%p of wrong type|can't check non-constant format|/example|/vendor)")
OUT=$(go vet -all=true "$ROOT_DIR" 2>&1 | grep --invert-match -E "(Checking file|\%p of wrong type|can't check non-constant format|/example|/vendor)")
if [ -n "$OUT" ]; then echo "$OUT"; PROBLEM=1; fi

echo "golint:"
OUT=$(golint ./... 2>&1 | grep --invert-match -E "(^(example|vendor))")
if [ -n "$OUT" ]; then echo "$OUT"; PROBLEM=1; fi

echo "staticcheck:"
OUT=$(staticcheck $PKG/... 2>&1 | grep --invert-match -E "((example|vendor)/)")
OUT=$(staticcheck "$PKG/..." 2>&1 | grep --invert-match -E "((example|vendor)/)")
if [ -n "$OUT" ]; then echo "$OUT"; PROBLEM=1; fi

if [ -n "$PROBLEM" ]; then exit 1; fi

0 comments on commit 3893fa7

Please sign in to comment.