Code formatting
Applies automatic Google Java code formatting conventions to the full source tree.
Not a lot of difference with current formatting except:
- Indentation size.
- Order of a few imports.
- Class header javadoc comments.
Thanks!
By including the Google Java format plugin, code check-ins which violate formatting will fail the build.
To apply automatic formatting use:
gradle googleJavaFormat
@Simonwep , are we clear to merge and keep going? Thanks.
Sorry for the late response, yes this looks really good! Didn't know that there plugins for Java to format code and stuff 😊 (I always used the IDE)
Only one thing - I'd actually prefer 4 spaces instead of 2 (regarding overall readability), or what do you think?
@Simonwep my apologies, as I just wrapped up a large project at work taking most of my time. Two space base indentation is generally recommended by Google's Java code style formatting conventions. A lot of projects follow it since it offers good readability in most IDEs.
https://google.github.io/styleguide/javaguide.html
Let me know if you'd prefer to keep it on 4 spaces and I'll close this PR. Thanks!
Hey, I totally understand and I'm grateful what you've already done! I'd actually stick to 4 spaces for readability and consistency, but I'm interested in googles code formatter - would it be possible to configure it using 4 spaces? Tabs would also work as we don't need to align any properties like in JSX, but in case of large code-blocks it's hard to distinguish 10 different levels of indentation.
Just thought i'd add, i have never see any Java project using 2 spaces.