Skip to content

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

Merged
thaJeztah merged 5 commits into
docker:27.xfrom
thaJeztah:27.x_backport_bump_golangci_lint
Nov 14, 2024
Merged

[27.x backport] bump golangci-lint to v1.61.0 and cleanup config#5613
thaJeztah merged 5 commits into
docker:27.xfrom
thaJeztah:27.x_backport_bump_golangci_lint

Conversation

@thaJeztah

Copy link
Copy Markdown
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 <github@gone.nl>
(cherry picked from commit 020f3a7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7451339)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 745629b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@codecov-commenter

codecov-commenter commented Nov 13, 2024

Copy link
Copy Markdown

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
Copy Markdown
MemberAuthor
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 <github@gone.nl>
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 <github@gone.nl>
(cherry picked from commit 9af049c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
thaJeztahforce-pushed the 27.x_backport_bump_golangci_lint branch from 20d29a4 to 8fe9372CompareNovember 14, 2024 08:44
@laurazard

Copy link
Copy Markdown
Member

I think it's fine as-is.

@laurazardlaurazard left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@laurazardlaurazard left a comment

Copy link
Copy Markdown
Member

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.xNov 14, 2024
@thaJeztah
thaJeztah deleted the 27.x_backport_bump_golangci_lint branch November 14, 2024 15:48
Sign up for freeto 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

@thaJeztah@codecov-commenter@laurazard