golint.bash: fix exit codes
We want to exit with 1 only if we we have complaints left after the greps.
This commit is contained in:
parent
863c3ca36f
commit
692b20f1b2
23
golint.bash
23
golint.bash
|
@ -1,7 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -u
|
||||||
|
|
||||||
golint ./... | \
|
OUTPUT=$(
|
||||||
grep -v "don't use an underscore in package name" | \
|
golint ./... | \
|
||||||
grep -v "don't use ALL_CAPS in Go names; use CamelCase" |
|
grep -v "don't use an underscore in package name" | \
|
||||||
grep -v "struct field allow_other should be allowOther" |
|
grep -v "don't use ALL_CAPS in Go names; use CamelCase" |
|
||||||
grep -v "struct field serialize_reads should be serializeReads"
|
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
|
||||||
|
|
|
@ -33,7 +33,7 @@ fi
|
||||||
if go tool | grep vet > /dev/null ; then
|
if go tool | grep vet > /dev/null ; then
|
||||||
go tool vet -all -shadow .
|
go tool vet -all -shadow .
|
||||||
else
|
else
|
||||||
echo "\"go tool vet\" not available - skipping"
|
echo "'go tool vet' not available - skipping"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We don't want all the subprocesses holding the lock file open
|
# We don't want all the subprocesses holding the lock file open
|
||||||
|
|
Loading…
Reference in New Issue