Skip to content

Commit

Permalink
Merge 535b33e into 5a41b26
Browse files Browse the repository at this point in the history
  • Loading branch information
rm3l authored Oct 24, 2022
2 parents 5a41b26 + 535b33e commit 95f26d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/check-gofmt.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

# Why we are wrapping gofmt?
# - ignore files in vendor directory
# - ignore files in certain directories, like 'vendor' or 'dist' (created when building RPM Packages of odo)
# - gofmt doesn't exit with error code when there are errors

GO_FILES=$(find . -path ./vendor -prune -o -name '*.go' -print)
GO_FILES=$(find . \( -path ./vendor -o -path ./dist \) -prune -o -name '*.go' -print)

for file in $GO_FILES; do
gofmtOutput=$(gofmt -l "$file")
Expand All @@ -17,7 +17,7 @@ done
if [ ${#errors[@]} -eq 0 ]; then
echo "gofmt OK"
else
echo "gofmt ERROR - These files are not formated by gofmt:"
echo "gofmt ERROR - These files are not formatted by gofmt:"
for err in "${errors[@]}"; do
echo "$err"
done
Expand Down

0 comments on commit 95f26d1

Please sign in to comment.