We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
This PR adds support for formatting ANTLR4 grammars using Antlr4Formatter and Gradle.
Checklist:
lib
Sorry, something went wrong.
first antlr4 dev version
ae9ef44
resolve antlr4 formatter lib at runtime
66f486a
prepare for PR (diffplug#326)
40daf9a
moved formatter to lib use formatter version available on maven central
add option to configure Antlr4Formatter version used
6663bba
rename step name
deb3a76
add docs for gradle extension
84b2cb5
remove mavenLocal development repository
55364f2
Merge remote-tracking branch 'upstream/master' into antlr4
d821563
# Conflicts: # CHANGES.md # plugin-gradle/CHANGES.md
add antlr4 maven support
f436c77
fix antlr4 includes/target docs
6dc960b
fix antlr4 default license header separator
77a82c9
be4175d
# Conflicts: # README.md
add Antlr4Formatter to maven-plugin Readme
38e2baa
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 do not merge the PR yet!
Looks great! Exemplary "add a language" PR. PaddedCell can be used to remedy idempotence problems, but it doesn't fix removing meaningful content :)
Looks great! Exemplary "add a language" PR.
Thanks! 😊
Merge remote-tracking branch 'upstream/master' into issue-326-antlr4
257b1bc
# Conflicts: # CHANGES.md # plugin-gradle/CHANGES.md # plugin-gradle/README.md # plugin-maven/CHANGES.md # plugin-maven/README.md
Merge branch 'master' into antlr4
8b7f53e
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: Looking at the antlr4formatter Github Project: https://github.com/antlr/Antlr4Formatter/graphs/contributors
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.
adding a framework to spotless that is at risk of not being maintained going forward
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.
2167c15
b351889
# 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
update Antlr4Formatter Version to upcoming release 1.2.1
341a8af
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 :)
528e708
64849c8
I'll lend a hand here.
Merge branch 'main' into antlr4
cacc0ac
Update license headers.
d5bb7a6
Add the antlr4 extension to SpotlessExtensionBase.
antlr4
83e1a02
Move the changelog entries to their correct location at [Unreleased].
[Unreleased]
8b261b4
Fix the maven and gradle integration tests.
b4530a1
Remove the unnecessary gradle-internals test dedicated to Antlr4.
ecf1861
If you force-push your branch to this location: https://github.com/diffplug/spotless/tree/antlr4
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 upstream/master into my local branch, so the branch name rebase is missleading ;) But if you want, I will polish the history later, when the build is back to green. Does that sound good?
upstream/master
rebase
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?
$ ./gradlew test FAILURE: Build failed with an exception. * Where: Build file '/home/balke/repositories/spotless/ide/build.gradle' line: 11 * What went wrong: A problem occurred evaluating project ':ide'. > A problem occurred configuring project ':lib'. > java.lang.NullPointerException (no error message) * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 1s
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
Our primary branch is now main, not master. And because of that confusion, your PR was changing 237 files due to copyright header, which is not correct. I just did something very rude, and force-pushed over yours, but hopefully now you can see what I meant. I backed up your branch before force-pushing at matthias-backup, so if you really want to go back to that, you can. But I can't merge something that changed 100s of files, too hard to review.
main
master
matthias-backup
Fix Antlr4Extension.
f111f2e
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.
fix expected format
3887435
289af25
Merge remote-tracking branch 'upstream/main' into issue-rebased
62e52f6
# Conflicts: # CHANGES.md # plugin-gradle/CHANGES.md # plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java
use a more generic default pattern
d946b3f
Move Antlr4Extension from the deprecated GradleProvisioner to the n…
GradleProvisioner
2bd12d7
…ew `provisioner()`.
Revert all README changes - I will put them back later.
837df92
Minor refactor of the antlr4 defaults.
60b9805
@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.
5070536
Put the antlr4formatter stuff back into the README. (as promised in #328
4a1e052
)
nedtwigg nedtwigg requested changes
thc202 thc202 left review comments
Successfully merging this pull request may close these issues.