Skip to content

Update golangci-lint to v2 and refine linter configurations #19692

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mmorel-35
Copy link
Contributor

Description

This updates golangci-lint to v2 and adapt associated tools/mod and configurations

@mmorel-35 mmorel-35 force-pushed the golangci-lint@v2 branch 4 times, most recently from b8cfd8f to d0f052c Compare March 29, 2025 10:03
Copy link

codecov bot commented Mar 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.51%. Comparing base (8f933a5) to head (da47213).
Report is 7 commits behind head on main.

Additional details and impacted files

see 48 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #19692      +/-   ##
==========================================
- Coverage   68.81%   67.51%   -1.30%     
==========================================
  Files         421      404      -17     
  Lines       35863    35373     -490     
==========================================
- Hits        24678    23881     -797     
- Misses       9754    10094     +340     
+ Partials     1431     1398      -33     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f933a5...da47213. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mmorel-35
Copy link
Contributor Author

/assign @wenjiaswe

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mmorel-35
Once this PR has been reviewed and has the lgtm label, please ask for approval from wenjiaswe. For more information see the Code Review Process.

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

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

@mmorel-35 mmorel-35 force-pushed the golangci-lint@v2 branch 6 times, most recently from fe289bc to f70205b Compare March 29, 2025 21:35
@henrybear327
Copy link
Contributor

/cc @ivanvc

/ok-to-test

@ivanvc
Copy link
Member

ivanvc commented Apr 16, 2025

@mmorel-35, can golangci-lint v2 run/work with a v1 configuration YAML file? I'm thinking if we can split up the single commit into multiple.

@mmorel-35
Copy link
Contributor Author

mmorel-35 commented Apr 16, 2025

I don't think so. I have tried to minimise modifications as much as possible to ease the review. If you're not using it try changing parameters to hide whitespace changes or use side by side comparison, it saved me a lot time on several occasions.
What's bothering you here ?

@ivanvc
Copy link
Member

ivanvc commented Apr 16, 2025

What's bothering you here ?

Nothing 😄, I wanted just to check if we could split the single commit into smaller commits (given the size of the commit), i.e., one for updating the dependency, and another doing the YAML migration + changes to the code. But it doesn't look like what you mentioned.

@mmorel-35 mmorel-35 force-pushed the golangci-lint@v2 branch 2 times, most recently from 4138eae to 3e2d80b Compare April 17, 2025 05:37
@mmorel-35
Copy link
Contributor Author

mmorel-35 commented Apr 17, 2025

@ivanvc,
I have provided the two commits and kept the go file modifications on the second commit so that when #19757 is merged the rebase will make them disapear from the PR and will stay coherent.

@ivanvc
Copy link
Member

ivanvc commented Apr 22, 2025

@mmorel-35, with #19757 merged, can you rebase this pull request? Thanks.

@mmorel-35
Copy link
Contributor Author

@ivanvc ,

can you rebase this pull request? Thanks.

That's ready

@ivanvc
Copy link
Member

ivanvc commented Apr 24, 2025

@mmorel-35, sorry for the back and forth regarding the number of commits. But, because we need the new YAML format to use golangci-lint v2, I think it makes more sense to have this in a single commit. The body of the commit can explain the two changes introduced by the single commit in detail.

After that, I think we'll be ready to merge :) Thanks again for the work, @mmorel-35!

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.

5 participants