Skip to content

[release-1.4] Bump golangci-lint to v2#1178

Open
ivanvc wants to merge 1 commit intoetcd-io:release-1.4from
ivanvc:release-1.4-bump-golangci-to-v2
Open

[release-1.4] Bump golangci-lint to v2#1178
ivanvc wants to merge 1 commit intoetcd-io:release-1.4from
ivanvc:release-1.4-bump-golangci-to-v2

Conversation

@ivanvc
Copy link
Copy Markdown
Member

@ivanvc ivanvc commented Apr 1, 2026

Manual backport of #954 / 675a3be.

Silence linters that fail with the current state of the code, as we don't want to change the stable release code.

Trying to unblock #1157 / The Go version bump (etcd-io/etcd#21458).

@k8s-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ivanvc
Once this PR has been reviewed and has the lgtm label, please assign spzala for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ivanvc
Copy link
Copy Markdown
Member Author

ivanvc commented Apr 1, 2026

Should we keep linting Windows files? I'd need to disable the formatter gofmt to make them pass. An alternative would be to not lint in Windows. WDYT, @ahrtr?

Manual backport of etcd-io#954 / 675a3be.

Silence linters that fail with the current state of the code, as we
don't want to change the stable release code.

Signed-off-by: Ivan Valdes <ivan@vald.es>
@ivanvc ivanvc force-pushed the release-1.4-bump-golangci-to-v2 branch from 982d57a to 0ee7f75 Compare April 1, 2026 19:49
@ahrtr
Copy link
Copy Markdown
Member

ahrtr commented Apr 1, 2026

I'd need to disable the formatter gofmt to make them pass

Can we fix the linter error?

@ivanvc
Copy link
Copy Markdown
Member Author

ivanvc commented Apr 1, 2026

I don't think so, it's an obscure error that we found before, which Windows complains of every file's first line:

https://github.com/etcd-io/bbolt/actions/runs/23867689295/job/69591112978?pr=1178#step:7:185

An alternative approach would be to use a separate configuration file for Windows that disables gofmt.

I also don't see much value in linting every file on Linux or Windows. In my opinion, we should have a single Lint CI workflow rather than appending the step to every workflow.

@Elbehery
Copy link
Copy Markdown
Member

Elbehery commented Apr 1, 2026

I don't think so, it's an obscure error that we found before, which Windows complains of every file's first line:

+1, I hit the same issue last year iirc

I recall I have tried using V2 to resolve it, but then hit the go-version used

we should have a single Lint CI workflow rather than appending the step to every workflow.

+1, good refactoring 👍🏽

use a separate configuration file for Windows that disables gofmt

I would keep this as the last resort, and we could skip it without a separate file imho

@ahrtr
Copy link
Copy Markdown
Member

ahrtr commented Apr 2, 2026

I don't think so, it's an obscure error that we found before, which Windows complains of every file's first line

Two questions:

  • what's the blocker to fix the linter error?
  • why there isn't such issue on main branch?

we should have a single Lint CI workflow rather than appending the step to every workflow.

Sounds good to me.

@ivanvc
Copy link
Copy Markdown
Member Author

ivanvc commented Apr 2, 2026

Two questions:

* what's the blocker to fix the linter error?

* why there isn't such issue on main branch?

These are good questions.

We have been trying to address this issue several times (i.e., #1073, #994). We don't know why it's not happening on the main branch. We thought it needed a newer Go version, but after the bump, it was still failing.

The problem now is that we need to bump golangci-lint to bump Go. So, that's why I suggest disabling linting on Windows. In the end, the only Windows file that the Linux linter is not linting is bolt_windows.go.

I would like to get this going, to not keep blocking the Go version bump.

we should have a single Lint CI workflow rather than appending the step to every workflow.

Sounds good to me.

I'll open a PR targeting the main branch to open the discussion.

@ahrtr
Copy link
Copy Markdown
Member

ahrtr commented Apr 3, 2026

We don't know why it's not happening on the main branch. We thought it needed a newer Go version, but after the bump, it was still failing.

OK, we don't have to spend too much time on this for stable releases. Pls feel free to workaround it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants