Skip to content

Commit

Permalink
Add GHA linting (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis authored Nov 1, 2023
1 parent 21ab254 commit 44503bc
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/actionlint-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "actionlint",
"pattern": [
{
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}
2 changes: 2 additions & 0 deletions .github/workflows/presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
- uses: ./.github/actions/install-deps
with:
k8sVersion: ${{ matrix.k8sVersion }}
- name: Enable the actionlint matcher
run: echo "::add-matcher::.github/actionlint-matcher.json"
- run: K8S_VERSION=${{ matrix.k8sVersion }} make presubmit
- uses: shogo82148/actions-goveralls@v1
with:
Expand Down
8 changes: 8 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ linters-settings:
min-complexity: 11
govet:
check-shadowing: true
revive:
rules:
- name: dot-imports
disabled: true
stylecheck:
dot-import-whitelist:
- "github.com/onsi/ginkgo/v2"
- "github.com/onsi/gomega"
misspell:
locale: US
ignore-words: []
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ verify: ## Verify code. Includes codegen, dependencies, linting, formatting, etc
if [ "${CI}" = true ]; then\
exit 1;\
fi;}
actionlint -oneline

download: ## Recursively "go mod download" on all directories where go.mod exists
$(foreach dir,$(MOD_DIRS),cd $(dir) && go mod download $(newline))
Expand Down
1 change: 1 addition & 0 deletions hack/toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tools() {
go install -tags extended github.com/gohugoio/hugo@v0.110.0
go install golang.org/x/vuln/cmd/govulncheck@latest
go install github.com/onsi/ginkgo/v2/ginkgo@latest
go install github.com/rhysd/actionlint/cmd/actionlint@latest

if ! echo "$PATH" | grep -q "${GOPATH:-undefined}/bin\|$HOME/go/bin"; then
echo "Go workspace's \"bin\" directory is not in PATH. Run 'export PATH=\"\$PATH:\${GOPATH:-\$HOME/go}/bin\"'."
Expand Down

0 comments on commit 44503bc

Please sign in to comment.