-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
R4R: Add goimports tool in makefile and format project #2767
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2767 +/- ##
===========================================
- Coverage 56.82% 56.65% -0.17%
===========================================
Files 120 156 +36
Lines 8298 9783 +1485
===========================================
+ Hits 4715 5543 +828
- Misses 3265 3862 +597
- Partials 318 378 +60 |
@@ -208,6 +208,7 @@ test_lint: | |||
format: | |||
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofmt -w -s | |||
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w | |||
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/cosmos/cosmos-sdk |
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.
Is goimports
an automatically included binary with Go? I can't recall. If not, we'll have to make sure it's installed via the Makefile.
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.
yeah, we need to ensure that
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 great! We just need need to make sure the goimports
binary is installed.
6c3d1d6
to
76f7ffb
Compare
@alexanderbez add the dependency in get_tools, because the url of the tool is different, so I just put the line in Makefile. |
@@ -116,6 +117,7 @@ update_dev_tools: | |||
get_tools: | |||
@echo "--> Installing tools" | |||
$(MAKE) -C scripts get_tools | |||
go get -u golang.org/x/tools/cmd/goimports |
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.
@ValarDragon @greg-szabo can we get this binary via the Makefile in /scripts
?
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.
we can do that if we change the format of command getting tools
merge conflicts need to be resolved before merge here |
40a8ad3
to
0a629b8
Compare
fixed |
(Apologies, I just found this PR, I don't know why I didn't see it earlier.) I would split this into two PRs:
The first one is something we need to thoroughly review, the second one is changing a lot of files in a predictable way. (Still worth reviewing but I feel it's easier.) Regarding the first one, we have to make sure people use I need to open a new PR if you want me to fix it. |
yeah, I am working on to change the Makefile, but it's different from other tools. if you are available, you can create a new one:) kinda busy lately it seems it will cause lint warning using goimports... |
I opened up the Option 1: No need to lock it down to a specific version: we can just put |
Ok, so I've opened a new PR #2889 that details the change to
@yutianwu please check that PR, I can't possibly go through all 212 files changed on this one to see I didn't miss anything you were trying to do. We can open a separate PR that will just be the result of the If everyone agrees with this approach, then this PR should be closed without merge. |
@greg-szabo I really like this approach. Lets move the work over to your PR. |
ref: #2766
docs/
)PENDING.md
with issue #Files changed
in the github PR explorerFor Admin Use: