-
Notifications
You must be signed in to change notification settings - Fork 268
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
chore: make format the whole repo #1516
base: v0.34.x-celestia
Are you sure you want to change the base?
Conversation
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.
LGTM w/ one optional idea
|
||
dbm "github.com/cometbft/cometbft-db" | ||
|
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.
[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.
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.
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.
weird shouldn't the lint ci block on these?
yes, its weird it doesn't. want me to investigate? |
runs
make format
andmake proto-format
to format the whole repo.This will make it easier to format next contributions without having to touch unrelated files.