Skip to content

Conversation

@marquiz
Copy link
Contributor

@marquiz marquiz commented Aug 26, 2025

Drop unnecessary nolint directives and unify the style of remaining ones to match the rest of the codebase (and the golangci-lint documentation).

@marquiz
Copy link
Contributor Author

marquiz commented Aug 26, 2025

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.

interesting nolint by itself on it's own line should be a no op, right?

should probably just delete them

@marquiz
Copy link
Contributor Author

marquiz commented Aug 26, 2025

interesting nolint by itself on it's own line should be a no op, right?

It's not. It's like nolint:all (AFAIU).

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

@mikebrow
Copy link
Member

just needs a dco then..

@marquiz
Copy link
Contributor Author

marquiz commented Aug 27, 2025

just needs a dco then..

Why I always forget the signoff 😢 Fixed

// Aliased request/response/event types for api/api.proto.
// nolint
//
//nolint:all
Copy link
Contributor

Choose a reason for hiding this comment

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

can we actgually mention the linters which complain here? Like

Suggested change
//nolint:all
//nolint:linter1,linter2 // [explanation why we don't lint]

Copy link
Member

Choose a reason for hiding this comment

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

@marquiz @saschagrunert Should we than have here //nolint:revive // [ignore warnings about generated types, names, etc.] here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@saschagrunert agree, I'm all in for this, i.e. only list the linters that actually raise some errors. The original spirit of the PR was only to change the style, not modify any behavior. If we start to do that I'd suggest to remove the unnecessary nolint directives (most of the ones touched here). Thoughts @saschagrunert @klihub ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Removing them if they're not required sounds fine to me.

Copy link
Member

Choose a reason for hiding this comment

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

@saschagrunert agree, I'm all in for this, i.e. only list the linters that actually raise some errors. The original spirit of the PR was only to change the style, not modify any behavior. If we start to do that I'd suggest to remove the unnecessary nolint directives (most of the ones touched here). Thoughts @saschagrunert @klihub ?

@marquiz True, I did not realize that only the one for the {Event,ContainerState}_-block is needed in pkg/adaptation/api.go. And it can be a selective one for revive.

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 for the feedback. I'll adjust the PR accordingly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@marquiz marquiz changed the title style: unify nolint directives chore: clean and unify nolint directives Aug 27, 2025
Drop unnecessary nolint directives and unify the style of remaining ones
to match the rest of the codebase (and the golangci-lint documentation).

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
@marquiz
Copy link
Contributor Author

marquiz commented Aug 27, 2025

Updated, adjusted commit message accordingly. Only one nolint directive left.

@klihub @saschagrunert

@klihub klihub merged commit 79f44b8 into containerd:main Aug 27, 2025
16 checks passed
@marquiz marquiz deleted the devel/nolint branch August 28, 2025 07:59
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