Open bodote opened 6 months ago
+1 This behaviour is extremely annoying when using palantir intellij plugin and spotless in the CI pipeline. We get errors from not having a new line at the end of classes when the plugin doesn't add it itself.
For reference the google style plugin (google and aosp versions) do add the new line when formatting a file. The spotless check should either not fail when there is or isn't a new line or the plugin should add a new line when using the format shortcut
Problem: using palantirJavaFormat with spotless maven : last character not a
\n
-> check failswhen creating a new java class using Intellij with palantir-java-format for formating all java files AND using spotless with palantirJavaFormat AND the last line in a java file is not an empty line but just
}
with no\n
appended THEN the spotless:check failswhat i would expect instead
I would expect that the check should pass no matter of the
\n
as the last character in java files, just as the palantir-java-plugin for intellij does not care.EDIT: and/or I expect that the Intellij palantir-java-plugin adds a
\n
to the end of each java file all by itself.Details:
copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
copy-paste the full content of any console errors emitted by
mvn -e spotless:check
java file: