-
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
ktLint 0.34 changes not compatible with spotless #419
Comments
Bummer :( Some relevant PR's for anyone who wants a guide for how to fix this: |
Sorry about this. I made a change to clean up the API for the lint and format APIs and moved editorconfig parsing out of Main.kt and into ktlint-core. I'll be sure to reach out the next time we make breaking API changes. pinterest/ktlint#503 |
No biggie, I'll be happy to merge a PR whenever someone gets around to it. FWIW, Kotlin has some great tools to allow you to refactor without breaking downstream clients: https://dzone.com/articles/deprecated-annotation-in-kotlin |
@shashachu Any updates on this? |
Please refrain from "bump comments" unless you have new information to offer. Versions of ktlint >= 0.34 will not work with Spotless until either or both of the following happen:
If you want to help with option 1, there are example PRs in my first comment that describe exactly how to do it. If you want to help with option 2, the PR which changed the KtLint API is also in this issue. Spotless is about people scratching their own itch. At some point, someone wanted KtLint support, so they built it. If it works, and has a test case, then we will merge it. We'll make sure that those testcases keep working forever, which we have done. We don't promise to follow every API change of every formatter we support - this would force us to be much choosier about letting people merge new features in, which would be a bummer. It should be (and has been) easier to add things to Spotless over time, not harder. |
Sorry, I wasn't aware that this was expected to be fixed on the |
It's opensource, we're all volunteers, nobody is expected to do anything! We've had cases in the past where a formatter broke their public API on accident, and then put the old methods back with
Fair enough, option 2 is off the table. Option 1 is probably 2 hrs of work, max, even if you haven't work on Spotless before. Happy to merge a PR from anyone. We support a ton of formatters, and we eagerly help people to merge changes they would like to see. We do not take proactive responsibility for adapting to breaking changes across the entire ecosystem that we support. |
due to diffplug/spotless#409 and diffplug/spotless#419 Update to Ktlint 0.34.2 and enable experimental rules.
I'm working on a PR for this |
Side note - I don't really understand the backward compatibility requirement for a formatter that doesn't have a stable API yet. Makes this quite brittle :/. Especially as the APIs being reflected are Kotlin, so much of reflected APIs are implementation details of the Kotlin compiler's outputs. |
Awesome, thanks very much! As a side note, the reflection isn't for backwards compatibility, it's for classpath isolation. We have formatters for |
Fixed in in |
Last version of ktLint 0.34 seems to have changes that are not compatible with spotless.
The text was updated successfully, but these errors were encountered: