-
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
Provide explicit support for Groovy source code #13
Comments
Anyone interested in #13 is invited to submit PR's against branch feature/groovy. Spotless' maintainers are not fans of Groovy. We'll help and support anyone who wants to contribute, but we don't actually know anything about it.
I just added the skeleton of a Groovy DSL on the branch |
Removed the feature/groovy branch, as it had gotten out-of-date. Just look at JavaExtension or FreshMarkExtension to see an updated example of adding a file-specific DSL. |
Hi. I am unfortunately also not a groovy expert. Actually I just wanted to know more about gradle, so I also had a look at Groovy. When I started to write my first dummy plugins, I searched for a better way to format code automatically (still used ANT...), so I found spotless and try to learn from its source how to write gradle plugins. |
@fvgh Ooh, nice! I'm glad someone's decided to have a go at this. Looking forward to anything you're able to dig up/code up. (No pressure!) 😉
Yes, please, if you do need any help, especially with integrating with Spotless, do let us know; I'm sure @nedtwigg or I can at least point you in the right direction if you get stuck. 😃 |
Great! We'll be happy to help you get your stuff merged, @fvgh. Have a look at the |
I provided a proposal for the formatter step implementation, where I made a few decisions which can be discussed/changed.
So in the end the JAR is independent for the gradle or Eclipse version and can be debugged easily. Drawback is the size.
We could discuss whether it would be better to share for example the Eclipse classes. @nedtwigg I think that I finally understood the p2AsMaven and Eclipse plugin. Could you check my final changes? |
The way you are using p2AsMaven and eclipse looks good to me. It is non-standard, but it looks like you have found a good solution to the problem of patches to JDT required by GrEclipse. I don't think the 18MB filesize is a problem. The greclipse jar will only get downloaded by people who want the Groovy formatter. Good work on including src, I don't think we did that for eclipse-jdt plugin, and it's very nice to have. Here's the things left to do, if I understand correctly
Since this work includes refactoring some existing functionality, I'd like to look at it closely and merge it in steps:
I'm gonna be slammed from now til Devoxx around 3/21. If you can cherry-pick your commits into these easy-to-review chunks, @jbduncan and I can merge them one at a time. If you're too busy, I'll be able to do this after 3/21. |
I was planing to deliver the missing code+tests+docs as well. As you pointed out, the work can be split into work-packages. So I was planing to deliver the following packages as soon as the the previous once are agreed.
My personal goal is just to get a good overview of gradle. So all these packages are proposals and I am not offended if you reject or correct them. Especially the fourth point is of course just optional and it is your decision whether you want to take the overhead into your build process. I just will implement it as a proof of concept. Two remaining issues on the GrEclipse:
|
Sounds great on all points! On integration of Re: Re: |
Thanks for the confidence 😃 |
Hi @nedtwigg and @fvgh, sorry for being quiet lately. I just wanted to say that I am most definitely interested in properly poring over your changes @fvgh, but I'm not sure when I'll have time to review it all properly, so would you be willing to allow me a few days, say a week at most, to review them and get back? If it's not possible for you to wait that long, or if it takes me longer than a week, then please feel free to continue collaborating amongst yourselves, and I'll do a post-commit review if or when I can. :) |
(No, sorry, please do continue collaborating regardless of whether I do get around to reviewing this!) |
@jbduncan I look forward to your feedback, but I think the thread is a little hard to follow from just the commit history of the experimental branch. @fvgh has a convincing story to tell through a series of PRs which will better explain his idea. Whenever a PR is uncontroversial, I'm going to merge it right away. When something has a broader impact, I'll be sure to let it sit for 12-24 hrs before merging so that you and anyone else who'd like to leave comment has a chance. He's got a nice fat feature for us, and requires only a modest amount of refactoring to make it work cleanly - I think it will be fairly easy to review after he's had a chance to submit in bite-sized chunks. |
@jbduncan There is no hurry. Most the initial PRs are anyway independent from each other and I can continue with the missing implementation on a dedicated branch. |
Providing explicit support for Groovy source code (fixes #13)
This will be deployed in a few minutes in 3.3.0-SNAPSHOT: https://oss.sonatype.org/content/repositories/snapshots/com/diffplug/spotless/spotless-plugin-gradle/ Let's make sure it works like the docs say, then I'll turn the release crank. |
I played briefly with the example provided. If you omit the |
Published in 3.3.0. Feel free to reopen or open new issues with subtasks for this 👍 |
Thanks for adding Groovy support! I've created junit-team/junit5#843 to use it for JUnit. The task is "up-for-grabs", pull requests are welcome! 😉 |
Thanks @marcphilipp for "reminding" 😉 me that I should add the Groovy support for JUnit. I am afraid, looking briefly at it today, I found two issues that require enhancements. Should be quickly done. |
@nedtwigg What is your schedule for 3.4.0? I may need 2 changes:
I still have too look on the latter issue, but have no time today. Can give you at least a final estimation this week-end. OK for you? |
I'm happy to release 3.4.0 anytime you would like, no schedule pressure from me. Btw, travis builds are broken for now. This security bug meant that I had to rotate all my secrets, and I haven't gotten around to updating all my opensource projects yet. I'll try to do that this evening. |
Travis is working again. |
Status Quo
Groovy source code files are not officially supported by Spotless.
You therefore have to hack something together like the following:
Without the custom regular expressions, Spotless will mangle Javadoc and license header comment blocks.
Proposal
The text was updated successfully, but these errors were encountered: