Skip to content

Commit

Permalink
travis: match gonum/gonum formatting checks
Browse files Browse the repository at this point in the history
  • Loading branch information
kortschak committed Mar 30, 2019
1 parent 894f385 commit 6055bac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ install:
- travis_wait 20 ${TRAVIS_BUILD_DIR}/.travis/$TRAVIS_OS_NAME/$BLAS_LIB/install.sh

script:
- ${TRAVIS_BUILD_DIR}/.travis/check-imports.sh
- ${TRAVIS_BUILD_DIR}/.travis/check-copyright.sh
- ${TRAVIS_BUILD_DIR}/.travis/check-imports.sh
- ${TRAVIS_BUILD_DIR}/.travis/check-formatting.sh
- ${TRAVIS_BUILD_DIR}/.travis/$TRAVIS_OS_NAME/$BLAS_LIB/test.sh
- test -z "$(gofmt -d .)"
# This is run last since it alters the tree.
- ${TRAVIS_BUILD_DIR}/.travis/check-generate.sh
8 changes: 8 additions & 0 deletions .travis/check-formatting.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

test -z "$(goimports -d .)"
if [[ -n "$(gofmt -s -l .)" ]]; then
echo -e '\e[31mCode not gofmt simplified in:\n\n'
gofmt -s -l .
echo -e "\e[0"
fi
1 change: 1 addition & 0 deletions .travis/check-generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ go generate gonum.org/v1/netlib/lapack/netlib

git checkout -- go.{mod,sum}
if [ -n "$(git diff)" ]; then
git diff
exit 1
fi

0 comments on commit 6055bac

Please sign in to comment.