Open andybalaam opened 8 years ago
Sometimes it's nice to put some extra spaces in to get something to line up.
I guess we need to decide if it's worth trading this in for more uniformity.
Aha. Tags can be used to turn off the formatter in certain regions.
http://stackoverflow.com/questions/5115088/turn-off-eclipse-formatter-for-selected-code-area
Yes, that's the nuclear option, and we can also adjust the format to allow things we like.
Artistic Style looks like it might do what we need.
I am considering starting a small project called Kevlin that runs a code formatter that formats code as Kevlin would have it.
It is possible to run Eclipse's code formatter from the command line*.
Eclipse's formatter is surprisingly effective and comprehensive - better than IDEA's (for my preferred style anyway) and better than anything else I've seen. If anyone knows better, please let me know because I'd much rather avoid depending on Eclipse.
So, make a Make target that formats all the Java code in the project (including Android code) in our preferred style.
Also, write instructions for IDEA and Android Studio to allow them to use the Eclipse Code Formatter plugin to share the same coding style.
If it didn't require a dependency on Eclipse, but something easier, I'd say it was mandatory to run this before committing, or even during every compile.