Skip to content

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

Merged
merged 4 commits into from
May 12, 2025

Conversation

radar07
Copy link
Contributor

@radar07 radar07 commented May 9, 2025

Use the latest version of golangci-lint and fix the CI workflow.

Closes: #378

Use the latest version of `golangci-lint` and fix the CI workflow.
@radar07 radar07 requested a review from a team as a code owner May 9, 2025 03:50
@radar07 radar07 changed the title jfeat: upgrade golangci-lint to v2 feat: upgrade golangci-lint to v2 May 9, 2025
@@ -8,21 +11,25 @@ linters:
- govet
- errcheck
- staticcheck
- gofmt
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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=$?
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@radar07 radar07 requested a review from williammartin May 9, 2025 18:46

formatters:
enable:
- gofmt
Copy link
Collaborator

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:
Copy link
Collaborator

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.

@williammartin
Copy link
Collaborator

Bypassing last pusher review requirement because my changes were minor to bring the linters into alignment with existing trunk (excluding some linters) and to fix a few small linter failures.

@williammartin williammartin merged commit 205b619 into github:main May 12, 2025
9 checks passed
@radar07 radar07 deleted the upgrade-golangci-lint branch May 15, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

golangci-lint run config for outputs
2 participants