Skip to content

Commit

Permalink
Merge pull request dnephin#65 from callofdutyops/master
Browse files Browse the repository at this point in the history
support pre-commit exclude
  • Loading branch information
dnephin committed Nov 21, 2020
2 parents 9690bb6 + 94241f3 commit ac0f658
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion run-go-critic.sh
@@ -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 ac0f658

Please sign in to comment.