goccmack / gocc

Parser / Scanner Generator
Other
622 stars 48 forks source link

Cleanup: Eliminate gofmt deltas #118

Closed kfsone closed 3 years ago

kfsone commented 3 years ago

Small change that causes make regenerate output to match what gofmt would produce.

Before: https://gist.github.com/kfsone/08956cdb42ed13c35a433ee5be24f840

After: (git checkout --force . && make -C example regenerate && make -C internal/test regenerate) >/dev/null && gofmt -l -s -d .

produces no output.

kfsone commented 3 years ago

In the checks, we should see no files listed as modified by gofmt or goimports.

kfsone commented 3 years ago

image

awalterschulze commented 3 years ago

Amazing.

So now it is technically unnecessary to run gofmt after running gocc?

I did this with goderive, another code generator as well, since gofmt can be quite slow on large files.

kfsone commented 3 years ago

So now it is technically unnecessary to run gofmt after running gocc?

Yep - we could probably refactor the Makefile into an incremental sequence culminating in make ci:

awalterschulze commented 3 years ago

I was just interested and happy with the result :)