Support Ktlint 2.0

Offen
#3,156 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
70/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
java, kotlin
Bereich
tooling

Rechercherichtung

Start with the two hardcoded-coordinate locations in lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java (lines 43–44 and 76). Check how the existing KtLint integration resolves its Maven artifact and invokes the CLI, then verify whether KtLint 2.0 also requires package-name adjustments. Done means KtLint 2.0 resolves and works through the supported entry point.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Since 2.0 (currently in alpha) Ktlint uses a new maven coordinate (io.github.ktlint.core), so 2.0 versions can't resolve. This is not workaround-able as the coordinates are hardcoded:

https://github.com/diffplug/spotless/blob/c810e6ba29a481d91a9972f1fe0aa49494a132c0/lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java#L43-L44

https://github.com/diffplug/spotless/blob/c810e6ba29a481d91a9972f1fe0aa49494a132c0/lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java#L76

Additionally, the package name has also changed to io.github.ktlint..., this might also needs an adjustment. I believe the CLI has not changed so if that is used as the only entrypoint, then only the coordinates need updating.

Vorherrschende Sprache
Java
Sterne
5.7k
Forks
565
Ø Merge
3 T. 7 Std.
Gemergte PRs (30 T.)
13

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus diffplug/spotless

Alle Issues in diffplug/spotless

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.