mirror of
https://github.com/containers/podman.git
synced 2025-10-11 16:26:00 +08:00

Disregard _output for gofmt'ing Signed-off-by: baude <bbaude@redhat.com> Closes: #77 Approved by: rhatdan
23 lines
411 B
Bash
Executable File
23 lines
411 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -o errexit
|
|
set -o nounset
|
|
set -o pipefail
|
|
|
|
find_files() {
|
|
find . -not \( \
|
|
\( \
|
|
-wholename '*/vendor/*' \
|
|
\) -prune \
|
|
\) -name '*.go' \
|
|
-not \( -wholename './_output/*' \)
|
|
}
|
|
|
|
GOFMT="gofmt -s"
|
|
bad_files=$(find_files | xargs $GOFMT -l)
|
|
if [[ -n "${bad_files}" ]]; then
|
|
echo "!!! '$GOFMT' needs to be run on the following files: "
|
|
echo "${bad_files}"
|
|
exit 1
|
|
fi
|