forked from quarkusio/quarkus-images
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#114 from frobware/add-verify-target
build: Add verify target
- Loading branch information
Showing
4 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
function print_failure { | ||
echo "There are unexpected changes to the vendor tree following 'go mod vendor' and 'go mod tidy'. Please" | ||
echo "run these commands locally and double-check the Git repository for unexpected changes which may" | ||
echo "need to be committed." | ||
exit 1 | ||
} | ||
|
||
if [ "${OPENSHIFT_CI:-false}" = true ]; then | ||
go mod vendor | ||
go mod tidy | ||
|
||
test -z "$(git status --porcelain)" || print_failure | ||
echo "verified Go modules" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
go_files=$( find . -name '*.go' -not -path './vendor/*' -print ) | ||
bad_files=$(gofmt -s -l ${go_files}) | ||
if [[ -n "${bad_files}" ]]; then | ||
(>&2 echo "!!! gofmt needs to be run on the listed files") | ||
echo "${bad_files}" | ||
(>&2 echo "Try running 'gofmt -s -d [path]' or autocorrect with 'hack/verify-gofmt.sh | xargs -n 1 gofmt -s -w'") | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters