Skip to content

Conversation

@markuspeloquin
Copy link

@markuspeloquin markuspeloquin commented Jun 3, 2023

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

@google-cla
Copy link

google-cla bot commented Jun 3, 2023

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.

@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
A maintainer will review your change and provide feedback. See
https://go.dev/doc/contribute#review for more info and tips to get your
patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.


Please don’t reply on this GitHub thread. Visit golang.org/cl/500555.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

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 comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Heschi Kreinick:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/500555.
After addressing review feedback, remember to publish your drafts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants