I am -1 for automated sources formatting by maven or any other tool.
What is better?
1. User getUser() { return user; }
or
2. User getUser() {
return user;
}
Even if you think that 2 is better than 1 it's just your personal preference.
It's hard to create & support formatting tool for different IDEs, if formatting rules are not simple
then they depend on IDE ability to deal with complicated structures like AST etc.
So the tool may force developer to use some tricks in source code to allow the tool to format the source in appropriate way
(like sunix did in his PR "//").
Let's say the formatting tool doesn't handle the code you think is readable and ok, e.g:
Builder.create()
.tag(...)
.innerTag(...)
.endTag();
.endTag()
.tag(...)
// ...
.build()
So what would you do, exclude the source file from formatting build phase?
Does it really worth it?
---
On the other hand there are rules like "use camel case for method names starting from non-capital letters" so it's "getUser" but not "GetUser" or "get_user",
which are basically not about formatting but rather about naming.
There are also rules about creating and structuring source files like this one "java source class must contain no more than 1 top level class".
---
Conclusion.
I would create a short list of rules mostly about naming, structuring and indentation and use it as our contribution guidelines instead
of documentation we have right now, which is close to Genady's point of view.
I think that the next flow is more than enough:
- PR reviewer might refer the guidelines(short list) if he thinks that the code he's reviewing breaks it