- Notifications
You must be signed in to change notification settings - Fork943
feat: upgrade golangci-lint to v2#386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -24,7 +24,7 @@ jobs: | ||
go mod verify | ||
go mod download | ||
LINT_VERSION=2.1.6 | ||
curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \ | ||
tar xz --strip-components 1 --wildcards \*/golangci-lint | ||
mkdir -p bin && mv golangci-lint bin/ | ||
@@ -45,6 +45,6 @@ jobs: | ||
assert-nothing-changed go fmt ./... | ||
assert-nothing-changed go mod tidy | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. What's the replacement, if any, for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more.
I suppose the | ||
bin/golangci-lint run --timeout=3m || STATUS=$? | ||
exit $STATUS |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# https://golangci-lint.run/usage/configuration | ||
version: "2" | ||
run: | ||
timeout: 5m | ||
tests: true | ||
@@ -8,21 +11,37 @@ linters: | ||
- govet | ||
- errcheck | ||
- staticcheck | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @radar07 can you talk me through these removals? Are they somewhere else? Were they removed? Are they in core? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I have take inspiration fromhere. | ||
- revive | ||
- ineffassign | ||
- unused | ||
- misspell | ||
- nakedret | ||
- bodyclose | ||
- gocritic | ||
- makezero | ||
- gosec | ||
settings: | ||
staticcheck: | ||
checks: | ||
- all | ||
- '-QF1008' # Allow embedded structs to be referenced by field | ||
- '-ST1000' # Do not require package comments | ||
revive: | ||
rules: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Turned off a few code comment rules. Not that they are wrong, but because we should turn them on intentionally rather than just because we're doing an upgrade. | ||
- name: exported | ||
disabled: true | ||
- name: exported | ||
disabled: true | ||
- name: package-comments | ||
disabled: true | ||
formatters: | ||
enable: | ||
- gofmt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @radar07 I removed
Totally unclear how to fix unless you understand what | ||
- goimports | ||
output: | ||
formats: | ||
text: | ||
print-linter-name: true | ||
print-issued-lines: true |