-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Do not reformat generated files #438
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
9d00bb1 to
773d4a6
Compare
|
This PR (HEAD: 773d4a6) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/tools/+/500555 to see it. Tip: You can toggle comments from me using the |
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/500555. |
|
Message from tricium-prod@appspot.gserviceaccount.com: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/500555. |
773d4a6 to
15a6f6b
Compare
|
This PR (HEAD: 15a6f6b) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/tools/+/500555 to see it. Tip: You can toggle comments from me using the |
|
Message from Heschi Kreinick: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/500555. |
I use code generation as well as goimports (actually the gosimports fork). Unfortunately, any generated files also need to be reformatted or it causes churn on commits. It would probably be good if there were commit hooks to check formatting automatically, but I also use
golangci-lint --fix, which is slow, and then you have to worry about commiting the changes. It'd be better if generated files were just left alone.What version of Go are you using (go version)? 1.20.4
What operating system and processor architecture are you using? linux, amd64
What did you do? go generate ./... && git commit -a && goimports -w .
What did you expect to see? I expected nothing to be reformatted
What did you see instead? Generated files are reformatted
https://pkg.go.dev/cmd/go#hdr-Generate_Go_files_by_processing_source