Skip to content

Commit

Permalink
Drop old KtLint support - 0.3x and 0.45.2 (#1475)
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg authored Jan 25, 2023
2 parents 33f4abe + aab121d commit 599d31b
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 414 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
### Changes
* Rename `YamlJacksonStep` into `JacksonYamlStep` while normalizing Jackson usage ([#1492](https://github.com/diffplug/spotless/pull/1492))
* Convert `gson` integration to use a compile-only source set ([#1510](https://github.com/diffplug/spotless/pull/1510)).
* ** POTENTIALLY BREAKING** Removed support for KtLint 0.3x and 0.45.2 ([#1475](https://github.com/diffplug/spotless/pull/1475))
* `KtLint` does not maintain a stable API - before this PR, we supported every breaking change in the API since 2019.
* From now on, we will support no more than 2 breaking changes at a time.

## [2.32.0] - 2023-01-13
### Added
Expand Down
22 changes: 3 additions & 19 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ for (glue in NEEDS_GLUE) {
versionCompatibility {
adapters {
namespaces.register('KtLint') {
// as discussed at https://github.com/diffplug/spotless/pull/1475
// we will support no more than 2 breaking changes at a time = 3 incompatible versions
// we will try to drop down to only one version if a stable API can be maintained for a full year
versions = [
'0.31.0',
'0.32.0',
'0.34.2',
'0.45.2',
'0.46.0',
'0.47.0',
'0.48.0',
Expand Down Expand Up @@ -81,21 +80,6 @@ dependencies {
ktlintCompileOnly "com.pinterest.ktlint:ktlint-ruleset-experimental:$VER_KTLINT"
ktlintCompileOnly "com.pinterest.ktlint:ktlint-ruleset-standard:$VER_KTLINT"

compatKtLint0Dot31Dot0CompileOnly 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.20'
compatKtLint0Dot31Dot0CompileOnly 'com.github.shyiko.ktlint:ktlint-core:0.31.0'
compatKtLint0Dot31Dot0CompileOnly 'com.github.shyiko.ktlint:ktlint-ruleset-experimental:0.31.0'
compatKtLint0Dot31Dot0CompileOnly 'com.github.shyiko.ktlint:ktlint-ruleset-standard:0.31.0'
compatKtLint0Dot32Dot0CompileOnly 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.20'
compatKtLint0Dot32Dot0CompileOnly 'com.pinterest.ktlint:ktlint-core:0.32.0'
compatKtLint0Dot32Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.32.0'
compatKtLint0Dot32Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.32.0'
compatKtLint0Dot34Dot2CompileOnly 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.20'
compatKtLint0Dot34Dot2CompileOnly 'com.pinterest.ktlint:ktlint-core:0.34.2'
compatKtLint0Dot34Dot2CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.34.2'
compatKtLint0Dot34Dot2CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.34.2'
compatKtLint0Dot45Dot2CompileOnly 'com.pinterest.ktlint:ktlint-core:0.45.2'
compatKtLint0Dot45Dot2CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.45.2'
compatKtLint0Dot45Dot2CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.45.2'
compatKtLint0Dot46Dot0CompileOnly 'com.pinterest.ktlint:ktlint-core:0.46.0'
compatKtLint0Dot46Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.46.0'
compatKtLint0Dot46Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.46.0'
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,9 @@ public KtlintFormatterFunc(String version, boolean isScript, boolean useExperime
} else if (minorVersion == 47) {
// rename RuleSet to RuleProvider
this.adapter = new KtLintCompat0Dot47Dot0Adapter();
} else if (minorVersion >= 46) {
} else {
// DefaultEditorConfigProperties.INSTANCE.getDefaultEditorConfigProperties() renamed to .getEditorConfigProperties()
this.adapter = new KtLintCompat0Dot46Dot0Adapter();
} else if (version.equals("0.45.2")) {
// add editorConfigOverride
this.adapter = new KtLintCompat0Dot45Dot2Adapter();
} else if (minorVersion >= 34) {
// KtLint.INSTANCE.format() now needs more parameters
this.adapter = new KtLintCompat0Dot34Dot2Adapter();
} else if (minorVersion >= 32) {
// rename packages from `com.github.shyiko` to `com.pinterest`
this.adapter = new KtLintCompat0Dot32Dot0Adapter();
} else {
// the OG
this.adapter = new KtLintCompat0Dot31Dot0Adapter();
}
this.editorConfigPath = editorConfigPath;
this.useExperimental = useExperimental;
Expand Down
Loading

0 comments on commit 599d31b

Please sign in to comment.