| 1 |
#!/bin/sh |
| 2 |
set -eu |
| 3 |
cd -- "$(dirname "$0")/.." |
| 4 |
|
| 5 |
go mod tidy |
| 6 |
(cd ./internal/thirdparty && go mod tidy) |
| 7 |
(cd ./internal/examples && go mod tidy) |
| 8 |
gofmt -w -s . |
| 9 |
go run golang.org/x/tools/cmd/goimports@latest -w "-local=$(go list -m)" . |
| 10 |
|
| 11 |
npx [email protected] \ |
| 12 |
--write \ |
| 13 |
--log-level=warn \ |
| 14 |
--print-width=90 \ |
| 15 |
--no-semi \ |
| 16 |
--single-quote \ |
| 17 |
--arrow-parens=avoid \ |
| 18 |
$(git ls-files "*.yml" "*.md" "*.js" "*.css" "*.html") |
| 19 |
|
| 20 |
go run golang.org/x/tools/cmd/stringer@latest -type=opcode,MessageType,StatusCode -output=stringer.go |
| 21 |
|
| 22 |
if [ "${CI-}" ]; then |
| 23 |
git diff --exit-code |
| 24 |
fi |