Skip to content

Commit

Permalink
Enable format enforcement.
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidtw committed Sep 27, 2017
1 parent dd4b7b2 commit b225973
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .travis.gofmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if [ -n "$(gofmt -s -l .)" ]; then
echo "Go code is not formatted:"
gofmt -s -d -e .
exit 1
fi
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ before_install:
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then docker exec build bash -c "pushd codecovio_build; git fetch origin +refs/pull/${TRAVIS_PULL_REQUEST}/merge && git checkout -qf FETCH_HEAD; popd"; fi'

script:
- docker exec build bash -c "export GOPATH=/codecovio_build && pushd codecovio_build/src && glide install --strip-vendor && cd caduceus && go build caduceus && go test -race -coverprofile=coverage.txt && popd"
- docker exec build bash -c "export GOPATH=/codecovio_build && pushd codecovio_build/src && glide install --strip-vendor && cd caduceus && go build caduceus && go test -race -coverprofile=coverage.txt && ../../.travis.gofmt.sh && popd"
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then docker exec build bash -c "pushd caduceus; ./build_rpm.sh; popd"; fi'

after_success:
Expand Down

0 comments on commit b225973

Please sign in to comment.