4 ms·
> how would continually changing code avoid formatting changes? It makes every single commit as ugly as this one. In other words, instead of only some of your
by crotchfire 3y ago
> how would continually changing code avoid formatting changes?
It makes every single commit as ugly as this one. In other words, instead of only some of your commits being full of formatting noise, all of them are, because touching any line causes rewrapping/reindentation of all the nearby lines.
Running a formatter on every single commit is dumb, unless you're an enormous company that doesn't release their software (i.e. Google and very few other companies).
If you ship your software, make the autoformatter part of the release process. Commit the reformat (to the trunk) right before each branch-off. It's a great compromise. Everything is autoformatted "in the limit" but the disruptive commits happen only once per release cycle. Formatting-only PRs get rejected with "please wait until the next release and/or teach the autoformatter to do whatever it is you want here"