-
Notifications
You must be signed in to change notification settings - Fork 459
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
Reinstate support for KtLint down to 0.31.0 and up to 0.47.1 (inclusive) #1303
Conversation
The io.github.davidburstrom.version-compatibility plugin provides sourcesets that make it possible to write adapters against specific versions of KtLint, and the correct adapter will be selected during runtime.
901d6b1
to
80a209b
Compare
I recommend reviewing this commit by commit. Let me know if I've missed something, this is the first time I'm contributing to Spotless. |
Nice work! I'd love it to be merged soon! |
There are a bunch of [breaking API changes](https://github.com/pinterest/ktlint/releases/tag/0.47.0) in the newest version of ktlint. Basically all rulesets need to be redefined. In 0.47.0 versions the previous ruleset versions coexist with the newers, so I added support for both in the mean time. In the future, the previous version of the rulesets will disappear. Also, undocumented by the migration guide, but all tests changed the way in which the assertThat classes are created, so I also updated all the tests to support the new version. Spotless is not yet compatible with 0.47.0, so I disabled the checks until it is (will likely [land soon](diffplug/spotless#1303)). I also updated all dependencies.
Yeah, I'd love to merge it but I need to have workflows approved first :) |
* Migrate to ktlint 0.47.0 There are a bunch of [breaking API changes](https://github.com/pinterest/ktlint/releases/tag/0.47.0) in the newest version of ktlint. Basically all rulesets need to be redefined. In 0.47.0 versions the previous ruleset versions coexist with the newers, so I added support for both in the mean time. In the future, the previous version of the rulesets will disappear. Also, undocumented by the migration guide, but all tests changed the way in which the assertThat classes are created, so I also updated all the tests to support the new version. Spotless is not yet compatible with 0.47.0, so I disabled the checks until it is (will likely [land soon](diffplug/spotless#1303)). I also updated all dependencies.
Is there anything I can do to help this PR move forward? |
80a209b
to
e77ea55
Compare
I verified that KtLint 0.47.1 also works. |
@davidburstrom Could you please run |
e77ea55
to
3dfb10e
Compare
@eirnym Done! Thanks for pointing it out. |
Thanks for a great PR, sorry for slow merge. This will be released by tomorrow AM. |
Released in |
…0.0 (mulk/mulkcms2!6) This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) | build | minor | `2.29.0` -> `2.30.0` | --- ### Release Notes <details> <summary>diffplug/spotless</summary> ### [`v2.30.0`](https://github.com/diffplug/spotless/blob/HEAD/CHANGES.md#​2300---2022-09-14) ##### Added - `formatAnnotations()` step to correct formatting of Java type annotations. It puts type annotations on the same line as the type that they qualify. Run it after a Java formatting step, such as `googleJavaFormat()`. ([#​1275](diffplug/spotless#1275)) ##### Changes - Bump default `ktfmt` version to latest `0.39` -> `0.40` ([#​1312](diffplug/spotless#1312)) - Bump default `ktlint` version to latest `0.46.1` -> `0.47.1` ([#​1303](diffplug/spotless#1303)) - Also restored support for older versions of ktlint back to `0.31.0` </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
Fixes #1281