Skip to content

Commit daec652

Browse files
committed
Add a lint script to golint correctly and use it
1 parent 55ecabe commit daec652

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ vendor-update:
3535
@echo
3636

3737
verify: check-reqs
38+
@./scripts/lint.sh
3839
@GO15VENDOREXPERIMENT=1 gometalinter -D gotype -E gofmt --errors --deadline=5m -j 4 $$(GO15VENDOREXPERIMENT=1 glide nv)
3940

4041
test:

scripts/lint.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#/bin/bash
2+
3+
# NOTE: This script needs be run from the root of the GD2 repository
4+
5+
# Find all Go source files in the repository, that are not vendored or generated
6+
# and then run golint on them
7+
8+
RETVAL=0
9+
10+
for file in $(find . -path ./vendor -prune -o -type f -name '*.go' -not -name '*.pb.go' -print); do
11+
golint -set_exit_status $file
12+
if [ $? -eq 1 -a $RETVAL -eq 0 ]; then
13+
RETVAL=1
14+
fi
15+
done
16+
exit $RETVAL

0 commit comments

Comments
 (0)