-
Notifications
You must be signed in to change notification settings - Fork 461
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
Alternatives to groovy eclipse formatter? #246
Comments
I am afraid I found no better alternative. Proposals are always welcome and I can assist with (or maybe even implement) the Spotless integration. Remember that the formatter is only one step in a formatting chain, so you can work-around some problems like I once demonstrated here. There are also some inconveniences for |
CodeNarc will detect all kinds of formatting violations in Groovy, but it won't fix them. There's project called npm-groovy-lint that will fix violations, but it is still in "beta". Also having a Java tool that calls Node.js that calls Java... 😭 |
Can work! We've got infrastructure for node.js-based formatters. But if the core of
This should never happen, because of paddedCell, which is always enabled in Spotless. If this happens, it means that the groovy formatter is somehow storing state from function call to function call. Two possible fixes:
In general, I think the best ROI would be fixing the bugs in |
The groovy eclipse formatter is very inconsistent with regard to formatting groovy and gradle files. This isn't spotless's problem, as similar behavior is apparent in Eclipse with the Groovy plugins installed. However, I thought this would be a good place to ask if anyone had discovered any alternatives.
As an example, this line:
spotlessCheck will not fail because of that block, yet spotlessApply will change it to:
I can create odd variances of the above, by moving the trailing brace of the block up. The formatter seems to really only trigger a failure consistently if the gradle files is very poorly formatted.
I have a sample project here that illustrates the problems with the groovy eclipse formatter: https://github.com/scottresnik/spotless-wildcard
Anyone have any good alternatives that work well with spotless?
The text was updated successfully, but these errors were encountered: