Skip to content

Commit

Permalink
Bump ktlint to 0.49.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszkwiecinski committed May 12, 2023
1 parent a97ca7e commit 8c28597
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ gradle-doctor = "0.8.1"
google-agp = "8.0.1"
maven-junit = "5.9.3"
maven-assertj = "3.24.2"
maven-ktlint = "0.49.0"
maven-ktlint = "0.49.1"
maven-commons = "2.11.0"

[libraries]
agp-gradle = { module = "com.android.tools.build:gradle", version.ref = "google-agp" }
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin" }
ktlint = { module = "com.pinterest:ktlint", version.ref = "maven-ktlint" }
ktlint-rule-engine = { module = "com.pinterest.ktlint:ktlint-rule-engine", version.ref = "maven-ktlint" }
ktlint-cli-ruleset-core = { module = "com.pinterest.ktlint:ktlint-cli-ruleset-core", version.ref = "maven-ktlint" }
ktlint-cli-reporter = { module = "com.pinterest.ktlint:ktlint-cli-reporter", version.ref = "maven-ktlint" }
ktlint-reporter-baseline = { module = "com.pinterest.ktlint:ktlint-reporter-baseline", version.ref = "maven-ktlint" }
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "maven-junit" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "maven-junit" }
assertj-core = { module = "org.assertj:assertj-core", version.ref = "maven-assertj" }
Expand Down
7 changes: 5 additions & 2 deletions ktlint-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ description = "Lint and formatting for Kotlin using ktlint with configuration-fr

configurations {
register("testRuntimeDependencies") {
extendsFrom(compileOnly)
attributes {
// KGP publishes multiple variants https://kotlinlang.org/docs/whatsnew17.html#support-for-gradle-plugin-variants
attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage.class, Usage.JAVA_RUNTIME))
Expand All @@ -32,15 +31,19 @@ configurations {
dependencies {
compileOnly(libs.kotlin.gradle)
compileOnly(libs.agp.gradle)
compileOnly(libs.ktlint)
compileOnly(libs.ktlint.rule.engine)
compileOnly(libs.ktlint.cli.ruleset.core)
compileOnly(libs.ktlint.cli.reporter)
compileOnly(libs.ktlint.reporter.baseline)

testRuntimeOnly(libs.junit.jupiter.engine)

testImplementation(libs.junit.jupiter.api)
testImplementation(libs.commons.io)
testImplementation(libs.assertj.core)

testRuntimeDependencies(libs.kotlin.gradle)
testRuntimeDependencies(libs.agp.gradle)
}

kotlin {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.usefulness.support

import com.pinterest.ktlint.cli.api.Baseline
import com.pinterest.ktlint.cli.api.loadBaseline
import com.pinterest.ktlint.cli.reporter.baseline.Baseline
import com.pinterest.ktlint.cli.reporter.baseline.loadBaseline
import com.pinterest.ktlint.cli.reporter.core.api.KtlintCliError
import java.io.File

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.usefulness.tasks.workers

import com.pinterest.ktlint.cli.api.doesNotContain
import com.pinterest.ktlint.cli.reporter.baseline.doesNotContain
import com.pinterest.ktlint.cli.reporter.core.api.KtlintCliError
import com.pinterest.ktlint.cli.reporter.core.api.KtlintCliError.Status
import io.github.usefulness.support.KtlintRunMode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.usefulness.tasks.workers

import com.pinterest.ktlint.cli.api.doesNotContain
import com.pinterest.ktlint.cli.reporter.baseline.doesNotContain
import io.github.usefulness.support.ReporterType
import io.github.usefulness.support.getBaselineKey
import io.github.usefulness.support.readKtlintBaseline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ internal class ExtensionTest : WithGradleTest.Kotlin() {
}
ktlint {
ktlintVersion = "0.46.0"
ktlintVersion = "0.32.0"
}
""".trimIndent()
Expand All @@ -217,12 +217,11 @@ internal class ExtensionTest : WithGradleTest.Kotlin() {

buildAndFail("lintKotlin").apply {
assertThat(task(":lintKotlinMain")?.outcome).isEqualTo(TaskOutcome.FAILED)
val expectedMessage = "com.pinterest.ktlint.cli.ruleset.core.api.RuleSetProviderV3: " +
"com.pinterest.ktlint.ruleset.standard.StandardRuleSetProvider not a subtype"
val expectedMessage = "ClassNotFoundException: com.pinterest.ktlint.rule.engine.api.KtLintRuleEngine"
assertThat(output).contains(expectedMessage)
}
build("dependencies", "--configuration", "ktlint").apply {
assertThat(output).contains("com.pinterest:ktlint:0.46.0")
assertThat(output).contains("com.pinterest:ktlint:0.32.0")
}
}

Expand Down
4 changes: 4 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
mavenContent { snapshotsOnly() }
}
}
}

Expand Down

0 comments on commit 8c28597

Please sign in to comment.