Skip to content
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

[27.x backport] bump golangci-lint to v1.61.0 and cleanup config #5613

Merged
merged 5 commits into from
Nov 14, 2024

Conversation

thaJeztah
Copy link
Member


  • golangci-lint: enable G204, add #nosec comments instead
  • golangci-lint: move gosec excludes to linters-settings
  • golangci-lint: update comment, and disable "exclude-dirs-use-default"
  • bump golangci-lint to v1.61.0

- A picture of a cute animal (not mandatory but encouraged)

There's only 3 locations where it's hit, so putting #gosec ignore comments
in those locations.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 020f3a7)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 7451339)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 745629b)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Nov 13, 2024

Codecov Report

Attention: Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 58.38%. Comparing base (e15a979) to head (8fe9372).
Report is 32 commits behind head on 27.x.

Additional details and impacted files
@@            Coverage Diff             @@
##             27.x    #5613      +/-   ##
==========================================
- Coverage   58.65%   58.38%   -0.27%     
==========================================
  Files         345      336       -9     
  Lines       29053    28782     -271     
==========================================
- Hits        17040    16805     -235     
+ Misses      11042    11010      -32     
+ Partials      971      967       -4     

@thaJeztah
Copy link
Member Author

65.28 cli/required.go:17:24: printf: non-constant format string in call to github.com/docker/cli/vendor/github.com/pkg/errors.Errorf (govet)
65.28 		return errors.Errorf("\n" + strings.TrimRight(cmd.UsageString(), "\n"))
65.28 		                     ^

Looks like that's fixed in a6e96c7, part of #5234, but not sure if we want to backport all of that

…govet)

     cli/required.go:17:24: printf: non-constant format string in call to github.com/docker/cli/vendor/github.com/pkg/errors.Errorf (govet)
     		return errors.Errorf("\n" + strings.TrimRight(cmd.UsageString(), "\n"))
     		                     ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Also updating a linter that was deprecated;

    The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 9af049c)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the 27.x_backport_bump_golangci_lint branch from 20d29a4 to 8fe9372 Compare November 14, 2024 08:44
@laurazard
Copy link
Member

I think it's fine as-is.

Copy link
Member

@laurazard laurazard 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!

Copy link
Member

@laurazard laurazard 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!

@thaJeztah thaJeztah merged commit fd53fe7 into docker:27.x Nov 14, 2024
87 checks passed
@thaJeztah thaJeztah deleted the 27.x_backport_bump_golangci_lint branch November 14, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants