Check files with go fmt in CI
This commit is contained in:
parent
d72f1c85c1
commit
a02c813784
@ -20,6 +20,7 @@ env:
|
|||||||
- GO15VENDOREXPERIMENT=1
|
- GO15VENDOREXPERIMENT=1
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
|
- ./script/check_formatting.sh
|
||||||
- ./script/check_assets.sh
|
- ./script/check_assets.sh
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
13
script/check_formatting.sh
Executable file
13
script/check_formatting.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
files="$(go fmt ./...)"
|
||||||
|
ignore="pkg/data/bindata.go"
|
||||||
|
files=${files[@]/$ignore}
|
||||||
|
|
||||||
|
if [ -n "$files" ]; then
|
||||||
|
echo "Go code is not formatted: $files"
|
||||||
|
for file in $files; do
|
||||||
|
echo "----> $file"
|
||||||
|
done
|
||||||
|
exit 1
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user