-
Notifications
You must be signed in to change notification settings - Fork 3
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 #1 from initia-labs/chore/add-lint-action
add workflow to lint and fix lint errors
- Loading branch information
Showing
8 changed files
with
61 additions
and
7 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 |
---|---|---|
|
@@ -23,6 +23,8 @@ concurrency: | |
jobs: | ||
golangci: | ||
env: | ||
GOPRIVATE: github.com/initia-labs | ||
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_READ_TOKEN }} | ||
GOLANGCI_LINT_VERSION: v1.59.1 | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
|
@@ -39,6 +41,7 @@ jobs: | |
**/**.go | ||
go.mod | ||
go.sum | ||
- run: git config --global url.https://${GITHUB_ACCESS_TOKEN}:[email protected]/.insteadOf https://github.com/ | ||
# install golangci-lint | ||
- run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION} | ||
- name: run go linters (long) | ||
|
@@ -65,6 +68,10 @@ jobs: | |
# Use --check or --exit-code when available (Go 1.19?) | ||
# https://github.com/golang/go/issues/27005 | ||
tidy: | ||
env: | ||
# for private repo access | ||
GOPRIVATE: github.com/initia-labs,github.com/skip-mev/slinky | ||
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_READ_TOKEN }} | ||
runs-on: ubuntu-latest | ||
name: tidy | ||
steps: | ||
|
@@ -74,6 +81,7 @@ jobs: | |
with: | ||
go-version: 1.22 | ||
check-latest: true | ||
- run: git config --global url.https://${GITHUB_ACCESS_TOKEN}:[email protected]/.insteadOf https://github.com/ | ||
- run: | | ||
go mod tidy | ||
CHANGES_IN_REPO=$(git status --porcelain) | ||
|
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,47 @@ | ||
linters: | ||
enable: | ||
- asciicheck | ||
- bodyclose | ||
- dogsled | ||
- dupl | ||
- errcheck | ||
- exportloopref | ||
- goconst | ||
- gofmt | ||
- goimports | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
# - nakedret | ||
- nolintlint | ||
# - prealloc | ||
- staticcheck | ||
# - structcheck // to be fixed by golangci-lint | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
- unused | ||
|
||
issues: | ||
exclude-rules: | ||
- path: _test\.go | ||
linters: | ||
- gosec | ||
- linters: | ||
- stylecheck | ||
text: "ST1003:" | ||
max-same-issues: 50 | ||
|
||
linters-settings: | ||
dogsled: | ||
max-blank-identifiers: 3 | ||
#golint: | ||
# min-confidence: 0 | ||
goconst: | ||
ignore-tests: true | ||
#maligned: | ||
# suggest-new: true | ||
misspell: | ||
locale: US |
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
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
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