Skip to content
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

Reformat all imports using gci linter #2198

Closed
alexandear opened this issue May 14, 2024 · 8 comments · Fixed by #3159
Closed

Reformat all imports using gci linter #2198

alexandear opened this issue May 14, 2024 · 8 comments · Fixed by #3159
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@alexandear
Copy link
Contributor

alexandear commented May 14, 2024

What would you like to be cleaned:

Reformat all imports using gci linter once the issue daixiang0/gci#135 is resolved.

Disable goimports because gci does the same work.

Why is this needed:

gci ensures consistency of the import order.

See discussions in #2069 and #2184.

@alexandear alexandear added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label May 14, 2024
@alexandear alexandear changed the title Enable gci linter and clean up lint import order issues Reformat all imports using gci linter May 14, 2024
@trasc
Copy link
Contributor

trasc commented May 14, 2024

Maybe I'm missing something, why do we need this gci ?

@alexandear
Copy link
Contributor Author

alexandear commented May 15, 2024

We need gci because it was introduced by PR #2069.

@alculquicondor
Copy link
Contributor

If the PR merged, doesn't it mean that we have no violations?

@alexandear
Copy link
Contributor Author

If the PR merged, doesn't it mean that we have no violations?

The PR #2069 didn't enable gci due to incorrect configuration, but the author and reviewers thought it was enabled. See the description in #2184 for a detailed explanation.

@alculquicondor
Copy link
Contributor

gotcha, so we can't re-enable gci just yet.

OTOH, we don't really use kube-builder scaffolding.

How reliable is this gci linter? The fact that it belongs to a person's github instead of an organization seems a bit worrisome.

@alexandear
Copy link
Contributor Author

gci has been included in golangci-lint since v1.30.0, so it's quite stable.

But let's ask the author of the original PR who wants to enable gci. @vladikkuzn, is it worth replacing goimports with gci?

@vladikkuzn
Copy link
Contributor

My opinion is that if it's stable with comments (which is the issue I didn't caught unfortunately) and it won't cause any further problems, then yes. It would make imports ordered the way everybody orders them, but automatically

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants