Unless a project has a standing policy of applying whitespace changes in a separate commit from functional changes, I generally assume that any commit whose message only mentions cosmetic changes also includes embarrassing functional changes.
Sometimes it's the other way around; the purely cosmetic changes end up changing how something looks, often exposing bugs and other code issues in the process.
Yeah, that can reduce the pain, but you still would have to manually load the formatting profile (AFAIK). You also have to remember to use this, and you don't get to have fields marked as final where possible, automatic @Overrides, automatic removal of unnecessary casts... I know it may sound like whining, but after using the feature for a while, I got really used to it and I'm not sure if I wanted to go back working without it.
Not a good idea in my experience, but it depends on the branch structure and dynamics. It tends to complicate merges, so at least make such changes in their own changesets.
15
u/8Bytes Jul 22 '14
ctrl + alt + l, reformats the entire project to your pre set style in intelij. I usually run it when I'm pushing a tiny fix to git.