Skip to content

Commit

Permalink
support pre-commit exclude
Browse files Browse the repository at this point in the history
  • Loading branch information
callofdutyops committed Nov 12, 2020
1 parent 9690bb6 commit 94241f3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion run-go-critic.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
#!/usr/bin/env bash
exec gocritic check ./...

failed=false

for file in "$@"; do
# redirect stderr so that violations and summaries are properly interleaved.
if ! gocritic check "$file" 2>&1
then
failed=true
fi
done

if [[ $failed == "true" ]]; then
exit 1
fi

0 comments on commit 94241f3

Please sign in to comment.