-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: updated linting to use golangci-lint CLI
- Loading branch information
Showing
23 changed files
with
505 additions
and
112 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 |
---|---|---|
|
@@ -14,19 +14,23 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 6 | ||
steps: | ||
- name: Checkout | ||
- uses: actions/checkout@v3 | ||
- name: Compute Diff | ||
- uses: technote-space/get-diff-action@v4 | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
|
||
- name: Compute diff 📜 | ||
uses: technote-space/[email protected] | ||
with: | ||
SUFFIX_FILTER: | | ||
.go | ||
.mod | ||
.sum | ||
- name: Run lint | ||
uses: golangci/golangci-lint-action@v3 | ||
- name: Setup Go 🧰 | ||
if: "env.GIT_DIFF != ''" | ||
uses: actions/setup-go@v3 | ||
with: | ||
version: v1.28 | ||
args: --timeout 10m | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
go-version: 1.18 | ||
|
||
- name: Run lint ✅ | ||
if: "env.GIT_DIFF != ''" | ||
run: make lint |
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,22 +1,72 @@ | ||
run: | ||
tests: false | ||
# # timeout for analysis, e.g. 30s, 5m, default is 1m | ||
# timeout: 5m | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- errcheck | ||
- bodyclose | ||
- deadcode | ||
- depguard | ||
- dogsled | ||
- gocritic | ||
- gofmt | ||
- goimports | ||
- golint | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- maligned | ||
- misspell | ||
- nakedret | ||
- scopelint | ||
- staticcheck | ||
- structcheck | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
- unused | ||
- unparam | ||
- misspell | ||
- govet | ||
- gocyclo | ||
linters-settings: | ||
gocyclo: | ||
min-complexity: 11 | ||
errcheck: | ||
ignore: fmt:.*,io/ioutil:^Read.*,github.com/spf13/viper:BindPFlag | ||
golint: | ||
min-confidence: 1.1 | ||
- nolintlint | ||
|
||
issues: | ||
exclude: | ||
- composite | ||
run: | ||
tests: false | ||
exclude-rules: | ||
- text: "Use of weak random number generator" | ||
linters: | ||
- gosec | ||
- text: "comment on exported var" | ||
linters: | ||
- golint | ||
- text: "don't use an underscore in package name" | ||
linters: | ||
- golint | ||
- text: "ST1003:" | ||
linters: | ||
- stylecheck | ||
# FIXME: Disabled until golangci-lint updates stylecheck with this fix: | ||
# https://github.com/dominikh/go-tools/issues/389 | ||
- text: "ST1016:" | ||
linters: | ||
- stylecheck | ||
|
||
- text: "singleCaseSwitch: should rewrite switch statement to if statement" | ||
linters: | ||
- gocritic | ||
|
||
max-issues-per-linter: 10000 | ||
max-same-issues: 10000 | ||
|
||
linters-settings: | ||
dogsled: | ||
max-blank-identifiers: 3 | ||
maligned: | ||
# print struct with more effective memory layout or not, false by default | ||
suggest-new: true | ||
nolintlint: | ||
allow-unused: false | ||
allow-leading-space: true | ||
require-explanation: false | ||
require-specific: false |
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
Oops, something went wrong.