-
Notifications
You must be signed in to change notification settings - Fork 29
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
refactor: consistent import order #1077
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1077 +/- ##
=======================================
Coverage 64.47% 64.47%
=======================================
Files 370 370
Lines 11790 11790
=======================================
Hits 7602 7602
Misses 3671 3671
Partials 517 517
|
I like it |
@plyr4 do you like it enough for it to be a linter rule that will gently remind folks that their import order might be ... out of order? golangci-lint does support |
@wass3rw3rk yeah it feels like a reasonable linter rule, especially if we can add it to our golangci-lint action |
can we supply the configurations you used in
as a file so we can commit the parameters to source? im not seeing anything in their docs, so maybe its enough to just put the command in our dev docs? |
@wass3rw3rk oh yeah exactly! i was thinking of it from "run gci with config" and not "run golangci-lint with gci config". that is great |
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.
Very cool. I am pro linter rule too
Co-authored-by: Jacob Floyd <[email protected]>
just testing the waters to see what folks think. maybe i'm not the only one bothered by import order being all over the place? i used gci via
gci write --custom-order -s standard -s default -s blank -s dot -s alias -s "prefix(github.com/go-vela)" .
gci write --custom-order -s standard -s default -s blank -s dot -s "prefix(github.com/go-vela)" .
(UPDATED - see comments) to format all of these. it's a little opinionated. was mostly going for std lib, third party, and our own imports last. we can add this to golangci as a check, but i didn't do it here (yet) to get feedback first.if we like it, we can apply to all repos.