-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix linter action * remove slinky from workflow
- Loading branch information
Showing
16 changed files
with
113 additions
and
52 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 |
---|---|---|
|
@@ -24,15 +24,18 @@ jobs: | |
golangci: | ||
env: | ||
# for private repo access | ||
GOPRIVATE: github.com/initia-labs/* | ||
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 | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
- uses: technote-space/get-diff-action@v5 | ||
check-latest: true | ||
- uses: technote-space/[email protected] | ||
id: git_diff | ||
with: | ||
PATTERNS: | | ||
|
@@ -41,26 +44,43 @@ jobs: | |
go.sum | ||
# for private repo access | ||
- run: git config --global url.https://${GITHUB_ACCESS_TOKEN}:[email protected]/.insteadOf https://github.com/ | ||
- name: run go linters | ||
# install golangci-lint | ||
- run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION} | ||
- name: run go linters (long) | ||
if: env.GIT_DIFF | ||
id: lint_long | ||
run: | | ||
make tools | ||
make lint | ||
if: env.GIT_DIFF | ||
- uses: technote-space/[email protected] | ||
if: steps.lint_long.outcome == 'skipped' | ||
with: | ||
PATTERNS: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
- name: run go linters (short) | ||
if: steps.lint_long.outcome == 'skipped' && env.GIT_DIFF | ||
run: | | ||
make lint | ||
env: | ||
GIT_DIFF: ${{ env.GIT_DIFF }} | ||
LINT_DIFF: 1 | ||
# 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/* | ||
GOPRIVATE: github.com/initia-labs,github.com/skip-mev/slinky | ||
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_READ_TOKEN }} | ||
runs-on: ubuntu-latest | ||
name: tidy | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Setup go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
check-latest: true | ||
# for private repo access | ||
- run: git config --global url.https://${GITHUB_ACCESS_TOKEN}:[email protected]/.insteadOf https://github.com/ | ||
- run: | | ||
|
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 |
---|---|---|
@@ -1,26 +1,44 @@ | ||
linters: | ||
disable-all: true | ||
enable: | ||
- asciicheck | ||
- bodyclose | ||
- dogsled | ||
- dupl | ||
- errcheck | ||
- golint | ||
- ineffassign | ||
- unconvert | ||
- misspell | ||
- govet | ||
# - unused | ||
# - deadcode | ||
- exportloopref | ||
- goconst | ||
- gofmt | ||
- goimports | ||
- gosec | ||
# - staticcheck | ||
linters-settings: | ||
gocyclo: | ||
min-complexity: 11 | ||
errcheck: | ||
ignore: fmt:.*,io/ioutil:^Read.*,github.com/spf13/cobra:MarkFlagRequired,github.com/spf13/viper:BindPFlag | ||
golint: | ||
min-confidence: 1.1 | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
# - nakedret | ||
- nolintlint | ||
# - prealloc | ||
- staticcheck | ||
# - structcheck // to be fixed by golangci-lint | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
- unused | ||
|
||
issues: | ||
exclude: | ||
- composite | ||
run: | ||
tests: false | ||
exclude-rules: | ||
- 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
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
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