-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
WIP: 🌱 Enable gci linter #4633
WIP: 🌱 Enable gci linter #4633
Conversation
This adds the gci linter to make sure imports are properly formatted and grouped. Signed-off-by: Sean McGinnis <[email protected]>
Hi @stmcginnis. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@stmcginnis I think we only wanted to add: exportloopref, ifshort, nilerr (#4624 (comment)) Although I personally really like that one and the grouping with local imports :) |
Thanks Stefan. I'll close this and maybe we can decide if we want to reopen it later. I do think it adds some nice checks that could help avoid nitpicking in commits. At least it uncovered that we have a bunch of importing errors. There are a surprising number of cases where we import the same package multiple times in a file under different aliases. In some cases this looks like maybe just mistakes as different people have worked on the same file, but in others they were very legitimate errors where we were originally using two different packages but accidentally updated to use the same one. (#4632) |
@stmcginnis Nice! I add a proposal about |
What this PR does / why we need it:
This adds the gci linter to make sure imports are properly formatted and
grouped. This will remove the need for code reviewers to nitpick PRs by
making it an objective result reported from a test.
Which issue(s) this PR fixes:
Related #4622
Hitting some failures when running
make test
that I need to investigate yet.Getting errors like:
Followed by failures from 500 results and other mismatches.