You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a typo in one of my java files, like: assertEquals(lines.stream().filter(x -> x.contains("jbang run ")).count(), ;'1);
notice the extra ;'.
when running spotless I get this error:
> java.lang.Exception: You are running Spotless on JRE 8, which limits you to google-java-format 1.7
If you upgrade your build JVM to 11+, then you can use google-java-format 1.9, which may have fixed this problem.
spent quite some time figuring out why that was happening since I'm using eclipse() in my config - but in the end it was because of the syntax error so I assume there is some bad logic around when having to show the google-java-format exception.
gradle v6, id "com.diffplug.spotless" version "5.7.0", OSX:
spotless {
lineEndings 'UNIX'
format 'misc', {
target '**/*.gradle', '**/*.md', '**/.gitignore'
targetExclude 'CONTRIBUTORS.md', 'src/main/scripts/container/README.md', 'build/container/README.md' // all-contributor bot adds non-indented code
trimTrailingWhitespace()
indentWithTabs(4) // or spaces. Takes an integer argument if you don't like 4
endWithNewline()
}
java {
importOrder 'java', 'javax', 'org', 'com', 'dev.jbang', ''
removeUnusedImports()
eclipse().configFile "misc/eclipse_formatting_nowrap.xml"
}
format 'xml', {
targetExclude 'build/test-results'
target '**/*.xml', '**/*.nuspec'
}
}
The text was updated successfully, but these errors were encountered:
I've been following jbang, wish you success with that project! removeUnusedImports() is powered by google-java-format behind the scenes. We got lots of bug reports from folks using Java 9+ features but using Java 8 for their gradle build, in which case GJF throws "unable to parse" errors, which is what you ran into.
Spotless is optimized towards "we'll just fix it", rather than "error here, you have to fix it". See this comment for more details. Happy to take a PR which improves this situation, but our primary usecase is to standardize the style of working code.
I had a typo in one of my java files, like:
assertEquals(lines.stream().filter(x -> x.contains("jbang run ")).count(), ;'1);
notice the extra
;'
.when running spotless I get this error:
spent quite some time figuring out why that was happening since I'm using
eclipse()
in my config - but in the end it was because of the syntax error so I assume there is some bad logic around when having to show the google-java-format exception.gradle v6,
id "com.diffplug.spotless" version "5.7.0"
, OSX:The text was updated successfully, but these errors were encountered: