The informal Spotless styleguide has been "any style that matters is enforced by spotlessApply". Now that we're compiling against Java 11 world, there's a big new degree of freedom, which is when to use var or not.
I'd like to adopt a style which is "you must always use var, unless the line has a comment".
// before spotlessApplyStringexample = "blah";
// after spotlessApplyvarexample = "blah";
// before spotlessApplyStringexample = "blah"; // keep type// after spotlessApplyStringexample = "blah"; // keep type
I'd like it to be a discrete step, ala
spotless { java {
gjf() // or whatever the user is currently usingalwaysUseVarUnlessCommented()
} }But if there's a way to configure an existing formatter, GJF, palantir-java-format, or eclipse, that would work too.
Suggestions and PRs welcome!
The informal Spotless styleguide has been "any style that matters is enforced by spotlessApply". Now that we're compiling against Java 11 world, there's a big new degree of freedom, which is when to use
varor not.I'd like to adopt a style which is "you must always use var, unless the line has a comment".
I'd like it to be a discrete step, ala
But if there's a way to configure an existing formatter, GJF, palantir-java-format, or eclipse, that would work too.
Suggestions and PRs welcome!