-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Makefile] Define make imports
#2162
Conversation
Makefile
Outdated
@$(call print, "Fixing imports.") | ||
goimports -w $(GOFILES_NOVENDOR) | ||
|
||
fmt: 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.
goimports
will also run gofmt
, so should we just replace it?
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.
Good observation, will look into it.
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 goimports
doesn't support code simplification, like we add here: #2118
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.
Should we just run both in make fmt
?
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.
As in don't define make 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.
Yep, agree it's better to keep all formatting tools under one target (make fmt
).
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.
Makes sense, done!
1eed432
to
8b44920
Compare
Also included the commit from #2118 to run formatting with simplification. |
9e26a9c
to
a540c61
Compare
2099cda
to
8ec6451
Compare
This has some performance problems with the usage of go modules. Will defer for now. Relevant: golang/go#27287 |
Looks like this is checked by |
8ec6451
to
7ea9cd5
Compare
@guggero Looks like it is not totally checked by the linter. I rebased it and re-ran. One import change only though :) |
7ea9cd5
to
c3b20e3
Compare
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.
Nice, LGTM 🌮
This PR defines
make imports
for runninggoimports
on the source. It also enables it for the linter and formats the affected files.