Skip to content

Commit c5b314c

Browse files
committed
make build fail on gofmt viiolations
1 parent cbc7e66 commit c5b314c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

screwdriver.yaml

+11-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,18 @@ jobs:
88
requires: [~commit, ~pr]
99
steps:
1010
- modverify: go version; go mod verify
11+
- gofmt: |
12+
gofmtOutput=$(gofmt -l .)
13+
if [ -z "${gofmtOutput}" ]; then
14+
echo "OK"
15+
else
16+
echo "gofmt violations in the following file(s):"
17+
echo "${gofmtOutput}"
18+
echo "\ngofmt diffs:"
19+
gofmt -d .
20+
exit 1
21+
fi
1122
- vet: go vet ./...
12-
- gofmt: gofmt -l .
1323
- build: go install -v ./...
1424
- test: go test -v ./...
1525

0 commit comments

Comments
 (0)