-
Notifications
You must be signed in to change notification settings - Fork 460
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
spotless-groovy with spock where throws error #357
Comments
Parser errors lead per default to an abortion of the Spotless task. Have a look at the description... It seems that the latest groovy-eclipse release fixed the parser problem. The Spotless formatter still uses version 3.0.0. But I am afraid that the formatted code does not look that nice 😞 . Let's keep the issue open as a reminder to upgrade the Spotless formatter for groovy-eclipse. But I am afraid, it may take a while... |
Ah:
I noticed that the I wasn't entirely sure if:
Would let me define a |
For Eclipse JDT this is nearly as simple, since their JARs are available via M2. |
I did a little more digging on this. After So given:
the formatter will end up with:
So even after making it not fail during the spotless check, it will still fail to compile. |
@AnEmortalKid I am afraid that even with the latest Groovy-Eclipse version the formatted code may not compile. At least the formatted code looked dodgy. I only checked (using Eclipse IDE with latest Groovy-Eclipse release) whether the formatter throws an exception. It did not, but as mentioned before, the formatter code looked not very nice / dodgy. I am afraid I can only provide the glue between Groovy-Eclipse formatter and Spotless. Issues within the Groovy-Eclipse should be discussed directly with the Groovy-Eclipse team. |
I've created an issue in that repository. Maybe once that's resolved this will be resolved too (or be able to be resolved with dependency updating). |
Also, @fvgh question on the I found that just specifying it in a file and configuring spotless:
Wouldn't pickup the ignore formatter problems. However, specifying more properties in the file would end up picking up |
@AnEmortalKid Sorry, I was occupied with other things. About your last comment, so you say that if you have only one property in the properties file does not work? |
No worries @fvgh , I understand life gets busy. Yeah, it didn't seem to be picking a single property, so I had to have more than one or maybe my property was wrong. I can double check but this is what i had iirc
https://github.com/AnEmortalKid/spotless-check/blob/master/formatter.properties Can't seem to get it to reproduce at the moment.... maybe it was user error. |
This part of the code is common for all Eclipse based formatters. So I cannot imagine a bug there. Anyhow, I'll check whether this dedicated scenario is part of the unit-test and add one if missing. Relating groovy/groovy-eclipse#822: I will provide an update to groovy-eclipse 3.2.0 for Eclipse 4.10. The |
It seemed to work for eric-milles, but I believe there's compilation errors in what it formatted: https://issues.apache.org/jira/browse/GROOVY-9004 |
@AnEmortalKid |
@fvgh thank you! I’ll upgrade at least :) |
Summary
An unexpected token
|
is found when formatting a specIf I comment out the
where
section or the test, everything works fine.Versions
Gradle + OS
Spotless config + Version:
Stacktrace
Repo: https://github.com/AnEmortalKid/spotless-check
The text was updated successfully, but these errors were encountered: