2 ms·
If you reflow the code, what are you going to do when you check it back in to version control? Are you going to check it in as you've reflown it, with your own
by gnosis 16y ago
If you reflow the code, what are you going to do when you check it back in to version control?
Are you going to check it in as you've reflown it, with your own indenting? If you do, and the reflowing substantially changed the indents, that could make the change you made harder to diff against (and possibly piss off the guy who's code you've re-indented).
Alternatively, you could indent it back to the way it was before you checked out the code.. that's kind of a pain in the butt, though (even with automatic indenting tools, which don't always get quite everything right).
- prodigal_erik 16y agoYou'd have to be fascist about everyone using the same pretty-printer settings, or every commit will appear to be a rewrite and features like "blame" will be useless. Better to only reformat lines you're changing anyway, if the whitespace is messy enough to bother (e.g., alternating tabs and spaces).
- michaelcampbell 16y agoOne possible solution is an "indent-on-commit" plugin. It pisses off EVERYONE equally =) It does get around some of this though; you don't have the diff issues, and everyone can indent how they like. Those that choose to use the same settings as the auto-indenter get pissed off the least. It's not ideal, but I think it does a reasonable job of at least minimizing the standard deviation of pissoffedness by spreading it around.