-
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
[WIP] Add ANTLR4 support #328
Conversation
moved formatter to lib use formatter version available on maven central
# Conflicts: # CHANGES.md # plugin-gradle/CHANGES.md
Just found something which seems to be a huge bug (antlr/Antlr4Formatter#25) in Antlr4Formatter. The bug seems to be removing parts of the grammar while formatting. So please review the spotless integration but |
lib/src/main/java/com/diffplug/spotless/antlr4/Antlr4Defaults.java
Outdated
Show resolved
Hide resolved
Looks great! Exemplary "add a language" PR. PaddedCell can be used to remedy idempotence problems, but it doesn't fix removing meaningful content :) |
Thanks! 😊 |
# Conflicts: # CHANGES.md # plugin-gradle/CHANGES.md # plugin-gradle/README.md # plugin-maven/CHANGES.md # plugin-maven/README.md
This is awesome. I love how pluggable Spotless is. Does this have automatic maven support for it or does more work need to be done to add that in the future? Another quick comment: It seems like it has very little activity and very little interactivity from the community. I just want to make sure that we aren't adding a framework to spotless that is at risk of not being maintained going forward (bit rot). Just something to consider @nedtwigg. It's not immediately a disqualifier for me, but I just want to let everyone think about it. |
This pr brings maven and gradle support. I know this project didn't have a lot of support. That's why I started to support it in December. Also I don't know about any other antlr4 formatter project. If you know one I be happy to take a look. Also the project is done by some of the official antlr4 guys, that is why I put my efforts there. |
Everything is at risk of not being maintained :) I'm very much in favor of merging in support for marginal and esoteric formatters, so long as they don't require changes to our core, which this does not. |
# Conflicts: # CHANGES.md # plugin-gradle/CHANGES.md # plugin-gradle/README.md # plugin-maven/CHANGES.md # plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java
Looks like we're almost there! Let me know if you need anything from me. |
I expect to publish a new release sometime this week. Do you think you'll get a chance to polish this up in that timeframe? If so I'm happy to wait to include this, else I'm just as happy to publish this whenever you get around to it :) |
I'll lend a hand here. |
If you force-push your branch to this location: then it will keep all the commits and discussion except for the recent rebase attempt. Thanks for your tenacity, I think it will be the oldest PR to actually get merged that I have ever worked with! |
I don't quite understand, how force-pushing my work to the new branch, should remove the rebase attempt? Actually I merged the The biggest problem I have right now, is that I'm having issues building spotless locally (Windows 10 and Ubuntu 20.04 using OpenJDK8). Do you have any idea, what I might do wrong?
And yeah I took me some time to get back to this, but I would love to get this merged too! Thanks for beeing so supportive. |
c05f205
to
ecf1861
Compare
Our primary branch is now |
lib/src/main/java/com/diffplug/spotless/antlr4/Antlr4Defaults.java
Outdated
Show resolved
Hide resolved
I think now all of the test failures are about the expected input/output of the step, not related to infrastructure. I'll let you take it from here. |
Now that this PR is nice and fixed-up, it's going to get merge-conflict clobbered again pretty soon, in ~week. I'm happy to work with you in realtime on https://gitter.im/diffplug/spotless if you have any hiccups. I think it's extremely close. |
# Conflicts: # CHANGES.md # plugin-gradle/CHANGES.md # plugin-maven/CHANGES.md # plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java
…ew `provisioner()`.
@nedtwigg I just double checked the format with the ANLR4 grammar itself and the format is as expected now! Thanks again for all the support! This PR is finally ready to be merged. |
Congrats on reaching a productive checkpoint on your long journey :D. I plan on releasing this (along with a bunch of other stuff) in a day or two. |
This PR adds support for formatting ANTLR4 grammars using Antlr4Formatter and Gradle.
Checklist:
lib
lib