-
Notifications
You must be signed in to change notification settings - Fork 961
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
Conversation
Use the latest version of `golangci-lint` and fix the CI workflow.
@@ -8,21 +11,25 @@ linters: | |||
- govet | |||
- errcheck | |||
- staticcheck | |||
- gofmt |
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.
@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 comment
The reason will be displayed to describe this comment to others. Learn more.
I have take inspiration from here.
@@ -45,6 +45,6 @@ jobs: | |||
assert-nothing-changed go fmt ./... | |||
assert-nothing-changed go mod tidy | |||
|
|||
bin/golangci-lint run --out-format=colored-line-number --timeout=3m || STATUS=$? |
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.
|
||
formatters: | ||
enable: | ||
- gofmt |
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.
@radar07 I removed gci
and golines
. I like them but they aren't included in most people's workflows and the errors can be opaque for example:
internal/ghmcp/server.go:17:1: File is not properly formatted (gci)
^
Totally unclear how to fix unless you understand what gci
is. Not worth the hassle.
- '-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 comment
The 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.
Bypassing last pusher review requirement because my changes were minor to bring the linters into alignment with existing |
Use the latest version of
golangci-lint
and fix the CI workflow.Closes: #378