- 
                Notifications
    You must be signed in to change notification settings 
- Fork 83
ci: bump golangci-lint to v2.4 #225
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
Conversation
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
Makes linters happier. Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
Mixed bag of comments for exported types. Makes revive happier. Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
Silence golangci-lint v2.4 errors that we don't want to fix. Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2c3ea95    to
    913f174      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
913f174    to
    9787127      
    Compare
  
    | mounts := g.Generator.Mounts() | ||
| g.Generator.ClearMounts() | ||
| mounts := g.Mounts() | ||
| g.ClearMounts() | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's OK, I'd like to disable the QF1008 in golangci-lint config. We've had some discussions around that quickfix in other projects, and think it's too opinionated to be applied as a "rule". In some cases it's good to abstract away that a type is embedded, but there's quite some cases where being explicit can be preferable, so it may be better to look at it "per-case" and not have the linter dictate that embedded types must be referenced implicitly.
(I have not looked in depth in which category this change itself should fall though)
https://github.com/moby/sys/blob/9dc3a90b82699c54554635f76a6a49757e02c523/.golangci.yml#L13-L19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @thaJeztah. Very valid point. I think in this particular case here dropping the embedded field makes sense.
I'd suggest to submit a separate PR about disabling the check.
@klihub et al wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's OK, I'd like to disable the
QF1008in golangci-lint config. We've had some discussions around that quickfix in other projects, and think it's too opinionated to be applied as a "rule". In some cases it's good to abstract away that a type is embedded, but there's quite some cases where being explicit can be preferable, so it may be better to look at it "per-case" and not have the linter dictate that embedded types must be referenced implicitly.
I am also fine with that. v2 feels IMO pretty opinionated even if you have put yourself repeatedly through the v1 wringer.
I'd suggest to submit a separate PR about disabling the check.
@klihub et al wdyt?
Yes, let's file a separate PR for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes and silences (nolint) linter errors and bumps golangci-lint version to the latest one.
Includes/depends on #222, #223 and #224