Enforce gofmt in travis
Run gofmt -l . during travis to catch pull requests that have not had gofmt run on them. Change-Id: Ibfdf988a535d82721f3c4bc328b189f606f12778
This commit is contained in:
parent
a028bf49ba
commit
5b0231b027
2 changed files with 8 additions and 0 deletions
7
.travis.gofmt.sh
Executable file
7
.travis.gofmt.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ -n "$(gofmt -l .)" ]; then
|
||||||
|
echo "Go code is not formatted:"
|
||||||
|
gofmt -d .
|
||||||
|
exit 1
|
||||||
|
fi
|
|
@ -15,6 +15,7 @@ before_script:
|
||||||
- source .travis.fix-fork.sh
|
- source .travis.fix-fork.sh
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
- ./.travis.gofmt.sh
|
||||||
- go test ./...
|
- go test ./...
|
||||||
- mkdir stage
|
- mkdir stage
|
||||||
- cd stage
|
- cd stage
|
||||||
|
|
Loading…
Reference in a new issue