DEV Community

IntelliJ google-java-format plugin vs IntelliJ java-google-style.xml - what's the deal?

Maximilian Koch on October 16, 2019

Code Style. One of those controversial topics, where everyone seems to have an opinion and no one seems to has the silver bullet. Recently, I was...
Collapse
 
jeremycoxbmi profile image
JeremyCoxBMI

I think the plugin gets the final word. Everyone's probably going to use it because it is automated, and it does what it wants to change the code. I came here because I recently saw a minor change in behavior, and I am researching. At the end of the day, it doesn't matter because the plugin has taken the power. Viva la plugin.

Collapse
 
dploeger profile image
Dennis Ploeger

I think, they're different because they're different things.

The xml tries to mimic the Google style guides using IntelliJs built in code formatter and is written by a third party. The plugin comes directly from Google and seems to be a wrapper around the official formatter by Google as there are plugins for other platforms as well.

To be as close as possible to the code style, I'd suggest the plugin over the xml.

I'm used to using Prettier but it seems they have no Java support currently.