-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [#15] Add GCI check explicitly to clarify to end-user how to res…
…olve it. (#19)
- Loading branch information
Showing
1 changed file
with
17 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,23 @@ runs: | |
go-version-file: 'go.mod' | ||
cache: false | ||
# | ||
# Check for 'incorrect import order', let pipeline fail if true and provide | ||
# instruction to remediate it. Note: check is included in golangci-lint, | ||
# but it does not provide clarity how to resolve it when positive. | ||
# | ||
- name: gci | ||
shell: bash | ||
run: | | ||
go install github.com/daixiang0/[email protected] | ||
if ~/go/bin/gci list --skip-generated . | grep -q ".*\.go$"; then | ||
echo "One or more 'incorrect import order' detected:" | ||
echo "" | ||
echo "$(~/go/bin/gci diff --skip-generated .)" | ||
echo "" | ||
echo "Resolve it by issuing: '~/go/bin/gci write --skip-generated .'" | ||
exit 1 | ||
fi | ||
# | ||
# Code security scanning. | ||
# | ||
- uses: 030/[email protected] | ||
|