mirror of
https://github.com/walles/moar.git
synced 2024-10-26 21:13:11 +03:00
Add gomft -s flag
Adds code simplifications. Recommended online somewhere.
This commit is contained in:
parent
1e211974e1
commit
d122901ca8
2
build.sh
2
build.sh
@ -2,7 +2,7 @@
|
||||
|
||||
if [ -z ${CI+x} ]; then
|
||||
# Local build, not in CI, format source
|
||||
go fmt .
|
||||
gofmt -s -w .
|
||||
fi
|
||||
|
||||
VERSION="$(git describe --tags --dirty --always)"
|
||||
|
8
test.sh
8
test.sh
@ -9,8 +9,8 @@ grep -En 'Background\([1-9]' ./*.go ./*/*.go && exit 1
|
||||
# Compile test first
|
||||
./build.sh
|
||||
|
||||
# Linting first
|
||||
MISFORMATTED="$(gofmt -l .)"
|
||||
# Linting
|
||||
MISFORMATTED="$(gofmt -l -s .)"
|
||||
if [ -n "$MISFORMATTED" ]; then
|
||||
echo >&2 "==="
|
||||
echo >&2 "ERROR: The following files are not formatted, run './build.sh', './test.sh' or 'go fmt .' to fix:"
|
||||
@ -19,6 +19,10 @@ if [ -n "$MISFORMATTED" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# FIXME: Add "go vet", catches fmt-placeholders-vs-args problems
|
||||
# FIXME: Add https://staticcheck.io/docs/
|
||||
# FIXME: Add https://github.com/kisielk/errcheck
|
||||
|
||||
# Unit tests first
|
||||
go test -timeout 20s ./...
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user