-
Notifications
You must be signed in to change notification settings - Fork 466
Groovy-Eclipse based Groovy formatter step implementation... #88
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
Conversation
…escription and smoke test. The implementation is independent form the other spotless modules. Follow the build instructions provided in the README.md.
Since the step implementation is independent, I thought you might give it a review already. |
This LGTM. I'm inclined to publish |
Depends how much effort it is for you in case a further patch is required. |
Most of the effort is the initial deploy. Future patches are easy. I'll merge and publish this tonight. |
OK. For the _ext problem I can open a dedicated issue where I can explain my concerns a little bit clearer. But I still need some research on composite builds and I also think you had in the past some discussion about how spotless shall handle sub-projects. |
Spotless is more "switchboard" than formatter. It combines formatters from other places. We try to accomplish this with as little glue code as possible - ideally, we can just call a few methods on a jar from mavencentral, as we do with freshmark, google-java-format, scala-fmt, and ktlint. In some cases, (such as eclipse-jdt and eclipse-groovy) we have no choice but to rebundle existing formatters so that they can be consumed by spotless. This "rebundling" is not part of Spotless' core mission. Eclipse JDT is actually in the process of migrating towards maven central - hopefully we won't need The only purpose of If you want to make changes in a shim from Most formatters don't need shims, so I don't want to force every Spotless contributor to muck with p2. If you figure out an elegant way around this problem, I'm all for it 👍 But I'm also fine with continuing to kick this minor can down the road. That means I'll just publish the shim as-is, and we can make changes to it later. |
I think we misunderstand each other. I have a concrete problem with the spotless in configuration in spotlessSelf.gradle, where I wondered how to reconfigure it. I think I see your point with _ext, it would just nice to tell 'target' to exclude _ext. But though I think the spotless configuration is easy for 99% of the use-cases, there might be composition builds where it needs more flexibility. And that flexibility would than also let me allow to reconfigure spotlessSelf.gradle. I think that target config should be similar to the way ANT deals with files sets. There you can use attributes for the easy way, and elements, if easy is not flexible enough.
And complex would look like:
To my understanding of groovy and and the Java implementation you did in the plugin-gradle, it should actually be simple to accept a closure as well for But the question is, whether this really should be solved by making the exclude pattern available, or whether spotless should respect more the gradle composite build structure (but here I still need to read a little bit more). I of course understand that spotless should also be usable to format resource and so on, so it is the question whether it should really follow a project/sub-project restriction. But I think that this had been already discussed somewhere. |
Sorry, yup, I misunderstood. What you want is possible. You can create a FileTree like so, and pass it to Sounds like you'd like to use this to change to |
Thanks for the clarification. Should not have raised the topic. Told you that I need to read a little bit more 😄 But go ahead. |
Ask away! If I can point you to a doc or code snippet rather than you having to scan the whole darn thing, I see that as a high-leverage use of our time :) |
... including description and smoke test.
The implementation is independent form the other spotless modules.
Follow the build instructions provided in the README.md.