Skip to content

Commit

Permalink
CI: Unbreak gofmt logic
Browse files Browse the repository at this point in the history
The script ".ci/go-static-checks.sh" was trying to exclude all vendor
files and files below pause/. However, the logic was incorrect meaning
the only file actually being gofmt-checked was pause.go!

Since the pause binary is now written in go [1], in fact we only want
to exclude "vendor/*" files.

---
[1] - clearcontainers#434

Fixes clearcontainers#624.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Sep 25, 2017
1 parent db1d30f commit 2212ef7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .ci/go-static-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ go vet $go_packages

cmd="gofmt -s -d -l"
echo "Running gofmt..."
diff=$(find . -not -wholename '*/vendor/*' -name '*.go' -wholename './pause/*' | \

# Note: ignore git directory in case any refs end in ".go" too.
diff=$(find . -not -wholename '*/vendor/*' -not -wholename '*/.git/*' -name '*.go' | \
xargs $cmd)
if [ -n "$diff" -a $(echo "$diff" | wc -l) -ne 0 ]
then
Expand Down

0 comments on commit 2212ef7

Please sign in to comment.