Skip to content

ci: update golangci-lint to v2.0.2 and adjust configuration #16356

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 3 commits into from
Apr 2, 2025

Conversation

mmorel-35
Copy link
Contributor

@mmorel-35 mmorel-35 commented Mar 31, 2025

Description

This updates golangci-lint to v2.0.2 with the associated configuration in workflows and script

Note: With the modification of script, it will require an update for every dependent project.

@mmorel-35 mmorel-35 force-pushed the golangci-lint@v2 branch 2 times, most recently from 05e21a9 to 0b6f490 Compare March 31, 2025 06:07
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
@aknuds1 aknuds1 requested a review from Copilot April 1, 2025 13:34
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the golangci-lint configuration to v2.0.2, ensuring that both CI workflows and supporting configuration files are in sync with the new version. It also adjusts the configuration settings to include new formatters and enables staticcheck with custom exclusions.

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
scripts/golangci-lint.yml Updated the golangci-lint GitHub Action and version to v2.0.2
.golangci.yml Revised configuration structure, added formatters, and configured staticcheck with custom rules
.github/workflows/ci.yml Updated the golangci-lint GitHub Action and version to v2.0.2 for CI consistency
Files not reviewed (1)
  • Makefile.common: Language not supported
Comments suppressed due to low confidence (2)

.golangci.yml:169

  • [nitpick] Consider clarifying or addressing the FIXME note in the staticcheck configuration to ensure that the intended linting behavior is clear before merging. This will help prevent unexpected linting issues in dependent projects.
# FIXME: We should enable this check once we have fixed all the issues.

.golangci.yml:132

  • [nitpick] Consider using consistent string quotation (e.g. double quotes) for configuration values across the file for better readability and consistency.
            - allowTypesBefore: '*testing.T,testing.TB'

Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

Please see comments.

Can you tell me whether there's a bug regarding testify-lint's useless-assert rule?

@aknuds1
Copy link
Contributor

aknuds1 commented Apr 1, 2025

I made a PR to fix issues found by golangci-lint v2.0.2 :)

@mmorel-35
Copy link
Contributor Author

Can you tell me whether there's a bug regarding testify-lint's useless-assert rule?

Yes but it is fixed by golangci/golangci-lint#5654 and will be included in golangci-lint next release

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

I think it looks good at this point, except adding output.sort-order configuration equivalent to the default is unnecessary.

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

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.

2 participants