-
Notifications
You must be signed in to change notification settings - Fork 30
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
Use Autostyle for formatting #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the community(s) related to those plugins, but to do not generate more merge conflicts I would like to wait with potential merge of that PR until #9 is merged.
@vlsi What was the reason for forking Spotless? |
Contributing to Spotless is hard :( I did try to contribute a feature: diffplug/spotless#485 Spotless is written in Java, and their choice for multi-line strings in tests is assertTaskFailure(task,
" testFile",
" @@ -2,9 +2,9 @@",
" u 1",
" u 2",
" u 3", which is very unpleasant to edit and update :( The PR was merged, however, then I found a bug in my implementation:
Ned has chosen to revert the PR altogether. Just in case: the bug was not detected by Spotless test suite since none of the tests included a case when a file had multiple violations that were separated with more than 3 lines. Ned is nice, however, their priorities seem to be tangential to my needs. For instance, Spotless does not support license headers for For instance, there's an open issue diffplug/spotless#496. On the other hand, I reworked that in Autostyle, so the license text is declared just once, and Autostyle formats it using the appropriate comment styles (e.g. it knows Java-like, XML, Shell, Windows CMD files). Spotless uses obscure Gradle techniques, so you can't re-execute the task that failed (you can't really copy-paste the task name from the failure log). It does not support Gradle Build Cache. Have you seen "paddedcell warning" in Spotless? When that happens Spotless provides no output on the actual contents, so you can't really understand what is misbehaving. For instance, I've migrated Apache Calcite from Spotless to Autostyle: apache/calcite#1682, Apache Calcite Avatica: apache/calcite-avatica#118, Apache JMeter: apache/jmeter#549. It increased the consistency of the source code, and it improved the error messages. All of the above (+ migration to Kotlin + migration to JUnit 5) seemed to be easier to implement in Autostyle than discussing in Spotless issues :( |
@vlsi Thanks for the detailed explanation! I'll take a closer look. |
@vlsi No offence, I think we'll stay with Spotless for now which works well enough for what we need for this small project here. |
See https://github.com/autostyle/autostyle/blob/master/CHANGES.md#version-30