-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce var
vs FullTypeName
in java 11
#1532
Comments
This sounds like a job for Refaster or OpenRewrite. If either of those could be integrated, then this issue should be easier to implement. |
Alternatively, on seeing comment #1379 (comment), I wonder if Eclipse has a reusable method we could use. 🤔 |
there was commit it seems don't know how to use it though eclipse-jdtls/eclipse.jdt.ls@e8e3c5e#diff-4b8c27e96cf0ef72f56e789c7366e6f522fb49bb0caf9dba777142d6417c9a45 |
Awesome! That jdt.ls action should be easy to integrate once #1524 gets merged. |
Thanks to @blacelle, we can now use cleanthat to enforce My initial thought was that it was important to have an easy way to keep the After seeing @blacelle's PR, I'm wondering if it's maybe not necessary to have a way to opt-out, and maybe making a specific |
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".
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!
The text was updated successfully, but these errors were encountered: