Skip to content
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

Use java source version for Google Format checks #1841

Open
laurentgo opened this issue Sep 29, 2023 · 1 comment
Open

Use java source version for Google Format checks #1841

laurentgo opened this issue Sep 29, 2023 · 1 comment

Comments

@laurentgo
Copy link
Contributor

Several spotless check actually use google-java-format under the hoods. When those checks are run from a JDK 17 environment but files are actually targeting Java 8 or Java 11, and also contains some reserved identifiers like yield, those checks would fail because files cannot be parsed (not because they are not conformant).

In general checks should use the version of the language used to compile those files, not the one used to run the plugin, so adding an option to either detect the version or allow the user to specify it would solve the issue.

@laurentgo
Copy link
Contributor Author

As it turns out, it seems google-java-format itself does not provide such an option. I created a ticket specifically for this project: google/google-java-format#975

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants