Skip to content

Conversation

@marquiz
Copy link
Contributor

@marquiz marquiz commented Aug 29, 2025

Fixes and silences (nolint) linter errors and bumps golangci-lint version to the latest one.

Includes/depends on #222, #223 and #224

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>
@marquiz
Copy link
Contributor Author

marquiz commented Aug 29, 2025

@marquiz marquiz force-pushed the devel/golangci-v2 branch from 2c3ea95 to 913f174 Compare August 29, 2025 10:46
@klihub klihub requested review from chrishenzie and klihub August 29, 2025 10:48
Copy link
Member

@klihub klihub left a 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>
@marquiz marquiz force-pushed the devel/golangci-v2 branch from 913f174 to 9787127 Compare August 29, 2025 10:52
Comment on lines -507 to +508
mounts := g.Generator.Mounts()
g.Generator.ClearMounts()
mounts := g.Mounts()
g.ClearMounts()
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

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 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.

Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM

@klihub klihub merged commit f3bda93 into containerd:main Aug 29, 2025
16 checks passed
@marquiz marquiz deleted the devel/golangci-v2 branch August 29, 2025 16:26
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.

4 participants