chore: make format the whole repo#1516
Conversation
rootulp
left a comment
There was a problem hiding this comment.
LGTM w/ one optional idea
|
|
||
| dbm "github.com/cometbft/cometbft-db" | ||
|
|
There was a problem hiding this comment.
[observation] make format runs:
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs goimports -w -local github.com/cometbft/cometbft
even though golangci.yml doesn't have any rules to special case the order of imports for github.com/cometbft/cometbft. In other words, this PR seems fine to me but a future contributor can accidentally modify the order of imports and we won't get signal on it.
IMO the order of imports isn't important so I propose we modify the Makefile to do this:
fmt:
@echo "--> Running golangci-lint --fix"
@golangci-lint run --fix
and then re-run make format to fix the issues that golangci.yml has identified and can fix.
evan-forbes
left a comment
There was a problem hiding this comment.
weird shouldn't the lint ci block on these?
|
yes, its weird it doesn't. want me to investigate? |
|
closing as this is targeting v0.34 but I wouldn't be surprised if we could do the same for v0.38 |
runs
make formatandmake proto-formatto format the whole repo.This will make it easier to format next contributions without having to touch unrelated files.