cloudflare/cloudflared
Publicmirrored from https://github.com/cloudflare/cloudflaredAvailable
.ci/scripts/fmt-check.sh
13lines · modecode
| 1 | #!/bin/bash |
| 2 | set -e -u -o pipefail |
| 3 | |
| 4 | OUTPUT=$(go run -mod=readonly golang.org/x/tools/cmd/goimports@v0.30.0 -l -d -local github.com/cloudflare/cloudflared $(go list -mod=vendor -f '{{.Dir}}' -a ./... | fgrep -v tunnelrpc)) |
| 5 | |
| 6 | if [ -n "$OUTPUT" ] ; then |
| 7 | PAGER=$(which colordiff || echo cat) |
| 8 | echo |
| 9 | echo "Code formatting issues found, use 'make fmt' to correct them" |
| 10 | echo |
| 11 | echo "$OUTPUT" | $PAGER |
| 12 | exit 1 |
| 13 | fi |