-
Notifications
You must be signed in to change notification settings - Fork 53
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
✨ Import grouping linter changes #748
Conversation
golangci-lint will now group imports in the following order: - standard library - 3rd party packages outside of our Github org - packages from our Github org - local imports from operator-controller Signed-off-by: Tayler Geiger <tayler@redhat.com>
All imports should now be properly ordered according to the gci group import rules. Signed-off-by: Tayler Geiger <tayler@redhat.com>
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #748 +/- ##
=======================================
Coverage 63.81% 63.81%
=======================================
Files 22 22
Lines 1415 1415
=======================================
Hits 903 903
Misses 459 459
Partials 53 53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- standard | ||
- default | ||
- prefix(github.com/operator-framework) | ||
- prefix(github.com/operator-framework/operator-controller) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about using localmodule
for implicitly handling the imports from the same module?
- prefix(github.com/operator-framework/operator-controller) | |
- localmodule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea, I'll throw up another small PR soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we want dot or alias groups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say we do not need a separate group for those.
I would even consider disallowing dot imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the localmodule section in gci hasn't hit golangci-lint yet
Description
This PR enables the gci linter in golangci-lint and adds configuration to group imports as follows:
Closes #510
Reviewer Checklist