-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
- 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 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 from here. |
||
- goimports | ||
- revive | ||
- ineffassign | ||
- typecheck | ||
- unused | ||
- gosimple | ||
- 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: colored-line-number | ||
print-issued-lines: true | ||
print-linter-name: true | ||
formats: | ||
text: | ||
print-linter-name: true | ||
print-issued-lines: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the replacement, if any, for
--out-format=colored-line-number
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
colored-line-number
has been enabled by default.I suppose the
--out-format
has been removed.