Skip to content

ci: add nolintlint and unconvert linters, fix found issues #2307

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

Merged
merged 7 commits into from
Apr 4, 2025

Conversation

kolyshkin
Copy link
Contributor

Please review commit by commit. See individual commits for details.

1. Move common code to atime() helper.
2. Use Atim.Unix to simplify conversion and avoid explicit typecasts.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Mostly to avoid explicit typecasts.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Those are the cases where the value being converted is already of that
type (checked to be that way for all os/arch combinations).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
For struct Stat_t in syscall pkg:
 - Ino is always uint64;
 - Dev/Rdev can be uint64, uint32, or int32;
 - Nlink might be uint64, uint32, or uint16.

Fix the code accordingly, adding or removing typecasts where needed,
and annotating those with //nolint:unconvert to calm down the unconvert
linter.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
> pkg/reexec/reexec.go:52:27: directive `//nolint: unused` is unused for linter "unused" (nolintlint)
> func naiveSelf() string { //nolint: unused
>                           ^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
> pkg/unshare/unshare_linux.go:471:64: directive `// nolint: revive,goprintffuncname` should be written without leading space as `//nolint: revive,goprintffuncname` (nolintlint)
> func bailOnError(err error, format string, a ...interface{}) { // nolint: revive,goprintffuncname
>                                                                ^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

openshift-ci bot commented Apr 2, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, kolyshkin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@TomSweeneyRedHat
Copy link
Member

LGTM
Thanks @kolyshkin !

@rhatdan
Copy link
Member

rhatdan commented Apr 4, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Apr 4, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 2dfd302 into containers:main Apr 4, 2025
20 checks passed
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.

4 participants