summaryrefslogtreecommitdiff
path: root/golint.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-04-30 13:14:54 +0200
committerJakob Unterwurzacher2017-04-30 13:14:54 +0200
commit692b20f1b2ec619ee9471ee070bc6b43c17284ee (patch)
tree638992363187019db76e225dedf961f7cf3df5d9 /golint.bash
parent863c3ca36fe756767ad2f86348a0646f2e7a09a5 (diff)
golint.bash: fix exit codes
We want to exit with 1 only if we we have complaints left after the greps.
Diffstat (limited to 'golint.bash')
-rwxr-xr-xgolint.bash23
1 files changed, 17 insertions, 6 deletions
diff --git a/golint.bash b/golint.bash
index 6da72c8..5040c12 100755
--- a/golint.bash
+++ b/golint.bash
@@ -1,7 +1,18 @@
-#!/bin/bash
+#!/bin/bash -u
-golint ./... | \
- grep -v "don't use an underscore in package name" | \
- grep -v "don't use ALL_CAPS in Go names; use CamelCase" |
- grep -v "struct field allow_other should be allowOther" |
- grep -v "struct field serialize_reads should be serializeReads"
+OUTPUT=$(
+ golint ./... | \
+ grep -v "don't use an underscore in package name" | \
+ grep -v "don't use ALL_CAPS in Go names; use CamelCase" |
+ grep -v "struct field allow_other should be allowOther" |
+ grep -v "struct field serialize_reads should be serializeReads"
+)
+
+# No output --> all good
+if [[ -z "$OUTPUT" ]] ; then
+ exit 0
+fi
+
+echo "golint.bash:"
+echo $OUTPUT
+exit 1