ignore .git dir when formatting

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
This commit is contained in:
Tiger Kaovilai
2024-05-01 11:39:24 -04:00
parent e1bef5b6c2
commit 3c937d42dd
6 changed files with 40 additions and 7 deletions

View File

@@ -33,7 +33,7 @@ if ! command -v goimports > /dev/null; then
exit 1
fi
files="$(find . -type f -name '*.go' -not -path './.go/*' -not -path './vendor/*' -not -path './site/*' -not -path '*/generated/*' -not -name 'zz_generated*' -not -path '*/mocks/*')"
files="$(find . -type f -name '*.go' -not -path './.go/*' -not -path './vendor/*' -not -path './site/*' -not -path './.git/*' -not -path '*/generated/*' -not -name 'zz_generated*' -not -path '*/mocks/*')"
echo "${ACTION} gofmt"
output=$(gofmt "${MODE}" -s ${files})
if [[ -n "${output}" ]]; then