Is it possible to remove trailing whitespace automatically on save in IntelliJ IDEA? I know there are some workarounds, for example, using git to trim the whitespace on commit.
Don't know about 12, but there's the following setting in 13:
Settings → Editor → Strip trailing spaces on Save
As of IntelliJ 2017.2 it's under
Settings → Editor → General → Strip trailing spaces on Save