-
Notifications
You must be signed in to change notification settings - Fork 458
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
Gradle: Fail Build if not formatted (with compileJava.dependsOn('spotlessApply')) #453
Comments
In this case, I don't think we can help without a public repo to reproduce. Generally speaking, when people have tried to do It looks like you are carefully avoiding the pitfall above. It looks to me like your code should work. If you make a public repo that reproduces this issue, I'll take a look. But my best guess is that there's some confusion, only because we have had so many issues in the past with this sort of confusion. |
I created a minimal example to reproduce here: https://github.com/vbrandl/spotless-bad-example Here is the unformatted file and line: https://github.com/vbrandl/spotless-bad-example/blob/master/src/main/webapp/index.xhtml#L11 Running
Now I
The |
Awesome! I'm able to repro on my machine, thanks for the example. Surprisingly, I think this turns out to be a dup (but much smaller and therefore easier to work with) of #338 TLDR, this will be fixed if you turn off paddedCell. But this should work, and this is a great testcase to help us fix the underlying bug. |
Turning off |
Yep. Lots of formatters have non-idempotent corner-cases. Looks like your prod repo has one of them. That's what paddedCell is for, but clearly something about it is broken. Your test repo is a perfect testcase for fixing it, and I'm happy to merge any PR's, but I won't get to investigating and implementing a fix myself until this weekend. I expect we should be able to ship a fix on Monday. |
Fixed in |
I am using Gradle 5.2 with version
3.24.2
of the spotless plugin.I want to format JSF XHTML files using the eclipse formatter, using the following config:
The goal is to automatically format the source on every build, when not in the CI environment but fail, if in the CI environment and the source is not formatted.
Formatting on every build works due to the
afterEvaluate
block, but when running./gradlew check
or./gradlew spotlessCheck
on unformatted sources, either in the CI environment or with theafterEvaluete
block commented out, the build does not fail.What am I missing? I want
check
andspotlessCheck
to fail, if the sources are not formatted...The text was updated successfully, but these errors were encountered: