Skip to content
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

Merged
merged 7 commits into from Sep 14, 2022

Conversation

davidburstrom
Copy link
Contributor

@davidburstrom davidburstrom commented Aug 29, 2022

Fixes #1281

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.
@davidburstrom
Copy link
Contributor Author

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.

@eirnym
Copy link
Contributor

eirnym commented Aug 30, 2022

Nice work! I'd love it to be merged soon!

mrmans0n added a commit to twitter/compose-rules that referenced this pull request Aug 30, 2022
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.
@davidburstrom
Copy link
Contributor Author

Yeah, I'd love to merge it but I need to have workflows approved first :)

mrmans0n added a commit to twitter/compose-rules that referenced this pull request Aug 30, 2022
* 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.
@davidburstrom
Copy link
Contributor Author

Is there anything I can do to help this PR move forward?

@davidburstrom davidburstrom changed the title Reinstate support for KtLint down to 0.31.0 and up to 0.47.0 (inclusive) Reinstate support for KtLint down to 0.31.0 and up to 0.47.1 (inclusive) Sep 9, 2022
@davidburstrom
Copy link
Contributor Author

I verified that KtLint 0.47.1 also works.

@eirnym
Copy link
Contributor

eirnym commented Sep 10, 2022

@davidburstrom Could you please run spotlessApply to make sure build passes?

@davidburstrom
Copy link
Contributor Author

@eirnym Done! Thanks for pointing it out.

@nedtwigg
Copy link
Member

Thanks for a great PR, sorry for slow merge. This will be released by tomorrow AM.

@nedtwigg
Copy link
Member

Released in plugin-gradle 6.11.0 and plugin-maven 2.26.0.

benkard added a commit to benkard/mulkcms2 that referenced this pull request Jan 14, 2023
…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#&#8203;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()`. ([#&#8203;1275](diffplug/spotless#1275))

##### Changes

-   Bump default `ktfmt` version to latest `0.39` -> `0.40` ([#&#8203;1312](diffplug/spotless#1312))
-   Bump default `ktlint` version to latest `0.46.1` -> `0.47.1` ([#&#8203;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-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ktlint 0.47.0 not supported
3 participants