mvdan / gofumpt

A stricter gofmt
https://pkg.go.dev/mvdan.cc/gofumpt
BSD 3-Clause "New" or "Revised" License
3.28k stars 113 forks source link

Generated file not ignored #298

Closed andig closed 7 months ago

andig commented 7 months ago

I'm a bit lost as to why this doesn't work. Using 0.6.0 against https://github.com/evcc-io/evcc/blob/9f1f1fe9862b12d3fa1ff67c1a809d21b491ba74/vehicle/mercedes/pb/client.pb.go. The file has the proper signature in the first line, no trailing spaces:

// Code generated by protoc-gen-go. DO NOT EDIT.

https://github.com/mvdan/gofumpt/pull/150 should take care of this: https://regex101.com/r/JNUC0W/1, yet CI still complains: https://github.com/evcc-io/evcc/actions/runs/8037154699/job/21951689222?pr=12403.

mvdan commented 7 months ago

gofmt is still enforced; only the extra rules are ignored for generated files. The README explains this.

Also, your repo uses gofmt, not gofumpt. So none of this matters.

andig commented 7 months ago

Ouch, sorry for the confusion!