Automate code formatting
Opened this issue · 4 comments
Checkstyle is great for consistency but annoying for developers. I looked at https://github.com/google/google-java-format some time ago but perhaps there are better alternatives? Suggested by @delanym in #183.
I recommend formatter-maven-plugin. Can you export and upload an Eclipse format XML?
Eclipse XML format is a PITA to apply in IntelliJ IDEA (the plugins that exist are subpar in my experience).
Well that is the only option with this plugin, and I know IntelliJ can import & export to that directly. If it misses a few properties I can live with that. Anyway, I use the Adaptor for Eclipse Code Formatter which ensures full compat and I've got no complaints. Save actions are the real PITA.
Also suggest the impsort-maven-plugin.
My experiences with the formatter-maven-plugin have been positive so far. I know that diffplug/spotless is also a popular option. But it seems like an overkill and just uses the google formatter under the hood anyway.