mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-01 00:33:05 +08:00
a537d12f40
- Consolidate all checks into a "all-checks" target in the Makefile, and use it from tools/pre-push and ci.yml. - Remove trivial make targets, including "generate" and all the individual check targets. - Remove the trivial script tools/lint.sh. - Rename the "checkstyle" scripts to "check-fmt", which is more specific.
13 lines
357 B
Bash
Executable File
13 lines
357 B
Bash
Executable File
#!/bin/sh -e
|
|
# Check if Go files are properly formatted without modifying them.
|
|
|
|
echo 'Go files need these changes:'
|
|
# The grep is needed because `goimports -d` and `gofmt -d` always exits with 0.
|
|
if find . -name '*.go' | xargs goimports -d | grep .; then
|
|
exit 1
|
|
fi
|
|
if find . -name '*.go' | xargs gofmt -s -d | grep .; then
|
|
exit 1
|
|
fi
|
|
echo ' None!'
|