Skip to content

Commit 5726a49

Browse files
authored
Merge pull request #29 from digitalocean/mdl-travis-gofmt
travis: ensure files are gofmt'd
2 parents 6bc1e04 + e3e2c2e commit 5726a49

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ script:
1515
- go build -tags=gofuzz ./...
1616
- go vet ./...
1717
- staticcheck ./...
18+
- ./scripts/gofmt.sh
1819
- ./scripts/golint.sh
1920
- go test -race ./...
2021
- go test -c -race ./ovsdb

scripts/gofmt.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# Verify that all files are correctly gofmt'd, with the exception of
4+
# generated code.
5+
EXIT=0
6+
GOFMT=$(go fmt ./... | grep -v "ovsnl/internal/ovsh")
7+
8+
if [[ ! -z $GOFMT ]]; then
9+
echo -e "Files that are not gofmt'd:\n"
10+
echo "$GOFMT"
11+
EXIT=1
12+
fi
13+
14+
exit $EXIT

0 commit comments

Comments
 (0)