From e54470150c306d7e232563261228851df2773163 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 13 Jul 2024 23:27:02 -0700 Subject: [PATCH] Bump org.jmailen.kotlinter from 4.3.0 to 4.4.0 (#387) * Bump org.jmailen.kotlinter from 4.3.0 to 4.4.0 Bumps org.jmailen.kotlinter from 4.3.0 to 4.4.0. --- updated-dependencies: - dependency-name: org.jmailen.kotlinter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * lint fixes --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jeremy Mailen --- gradle/libs.versions.toml | 2 +- .../kotlinter/support/KotlinterError.kt | 5 +---- .../gradle/kotlinter/support/LintFailure.kt | 4 +--- .../SortedThreadSafeReporterWrapper.kt | 4 +--- .../kotlinter/tasks/ConfigurableKtLintTask.kt | 21 +++++++------------ .../functional/InstallHookTaskTest.kt | 5 +---- .../kotlinter/functional/WithGradleTest.kt | 6 ++---- 7 files changed, 15 insertions(+), 32 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a5b1395e..df4c2e41 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ junit = "5.10.3" mockito = "4.1.0" commons-io = "2.16.1" gradle-publish = "1.2.1" -kotlinter-check = "4.3.0" +kotlinter-check = "4.4.0" [libraries] ktlint-rule-engine = { group = "com.pinterest.ktlint", name = "ktlint-rule-engine", version.ref = "ktlint" } diff --git a/src/main/kotlin/org/jmailen/gradle/kotlinter/support/KotlinterError.kt b/src/main/kotlin/org/jmailen/gradle/kotlinter/support/KotlinterError.kt index fcf9019d..24af2787 100644 --- a/src/main/kotlin/org/jmailen/gradle/kotlinter/support/KotlinterError.kt +++ b/src/main/kotlin/org/jmailen/gradle/kotlinter/support/KotlinterError.kt @@ -2,7 +2,4 @@ package org.jmailen.gradle.kotlinter.support import org.gradle.api.GradleException -class KotlinterError( - message: String, - error: Throwable, -) : GradleException(message, error) +class KotlinterError(message: String, error: Throwable) : GradleException(message, error) diff --git a/src/main/kotlin/org/jmailen/gradle/kotlinter/support/LintFailure.kt b/src/main/kotlin/org/jmailen/gradle/kotlinter/support/LintFailure.kt index 5f91484d..b23369b0 100644 --- a/src/main/kotlin/org/jmailen/gradle/kotlinter/support/LintFailure.kt +++ b/src/main/kotlin/org/jmailen/gradle/kotlinter/support/LintFailure.kt @@ -2,6 +2,4 @@ package org.jmailen.gradle.kotlinter.support import org.gradle.api.GradleException -class LintFailure( - message: String, -) : GradleException(message) +class LintFailure(message: String) : GradleException(message) diff --git a/src/main/kotlin/org/jmailen/gradle/kotlinter/support/SortedThreadSafeReporterWrapper.kt b/src/main/kotlin/org/jmailen/gradle/kotlinter/support/SortedThreadSafeReporterWrapper.kt index 9c8dca7e..e955c150 100644 --- a/src/main/kotlin/org/jmailen/gradle/kotlinter/support/SortedThreadSafeReporterWrapper.kt +++ b/src/main/kotlin/org/jmailen/gradle/kotlinter/support/SortedThreadSafeReporterWrapper.kt @@ -10,9 +10,7 @@ import java.util.concurrent.ConcurrentSkipListSet * A wrapper for a Reporter that guarantees thread safety and consistent ordering of all the calls to the reporter. * As a downside, the calls to the wrapped reporter are delayed until the end of the execution. */ -class SortedThreadSafeReporterWrapper( - private val wrapped: ReporterV2, -) : ReporterV2 { +class SortedThreadSafeReporterWrapper(private val wrapped: ReporterV2) : ReporterV2 { private val callsToBefore: ConcurrentMap = ConcurrentHashMap() private val lintErrorReports: ConcurrentMap> = ConcurrentHashMap() diff --git a/src/main/kotlin/org/jmailen/gradle/kotlinter/tasks/ConfigurableKtLintTask.kt b/src/main/kotlin/org/jmailen/gradle/kotlinter/tasks/ConfigurableKtLintTask.kt index 4c809d70..49a29a61 100644 --- a/src/main/kotlin/org/jmailen/gradle/kotlinter/tasks/ConfigurableKtLintTask.kt +++ b/src/main/kotlin/org/jmailen/gradle/kotlinter/tasks/ConfigurableKtLintTask.kt @@ -18,10 +18,7 @@ import org.gradle.work.InputChanges import org.jmailen.gradle.kotlinter.KotlinterExtension.Companion.DEFAULT_IGNORE_FAILURES import org.jmailen.gradle.kotlinter.support.findApplicableEditorConfigFiles -abstract class ConfigurableKtLintTask( - projectLayout: ProjectLayout, - objectFactory: ObjectFactory, -) : SourceTask() { +abstract class ConfigurableKtLintTask(projectLayout: ProjectLayout, objectFactory: ObjectFactory) : SourceTask() { @get:InputFiles @get:PathSensitive(PathSensitivity.RELATIVE) @@ -51,12 +48,10 @@ internal inline fun ObjectFactory.mapProperty(default: Ma set(default) } -inline fun Throwable.workErrorCauses(): List { - return when (this) { - is MultiCauseException -> this.causes.map { it.cause } - else -> listOf(this.cause) - }.filter { - // class instance comparison doesn't work due to different classloaders - it?.javaClass?.canonicalName == T::class.java.canonicalName - }.filterNotNull() -} +inline fun Throwable.workErrorCauses(): List = when (this) { + is MultiCauseException -> this.causes.map { it.cause } + else -> listOf(this.cause) +}.filter { + // class instance comparison doesn't work due to different classloaders + it?.javaClass?.canonicalName == T::class.java.canonicalName +}.filterNotNull() diff --git a/src/test/kotlin/org/jmailen/gradle/kotlinter/functional/InstallHookTaskTest.kt b/src/test/kotlin/org/jmailen/gradle/kotlinter/functional/InstallHookTaskTest.kt index fd32e06e..a135a772 100644 --- a/src/test/kotlin/org/jmailen/gradle/kotlinter/functional/InstallHookTaskTest.kt +++ b/src/test/kotlin/org/jmailen/gradle/kotlinter/functional/InstallHookTaskTest.kt @@ -12,10 +12,7 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import java.io.File -abstract class InstallHookTaskTest( - private val taskName: String, - private val hookFile: String, -) : WithGradleTest.Kotlin() { +abstract class InstallHookTaskTest(private val taskName: String, private val hookFile: String) : WithGradleTest.Kotlin() { private lateinit var projectRoot: File @BeforeEach diff --git a/src/test/kotlin/org/jmailen/gradle/kotlinter/functional/WithGradleTest.kt b/src/test/kotlin/org/jmailen/gradle/kotlinter/functional/WithGradleTest.kt index 39415ea5..a61f05ee 100644 --- a/src/test/kotlin/org/jmailen/gradle/kotlinter/functional/WithGradleTest.kt +++ b/src/test/kotlin/org/jmailen/gradle/kotlinter/functional/WithGradleTest.kt @@ -35,10 +35,8 @@ abstract class WithGradleTest { abstract class Android : WithGradleTest() { - override fun gradleRunnerFor(vararg args: String): GradleRunner { - return defaultRunner(*args) - .withPluginClasspath() - } + override fun gradleRunnerFor(vararg args: String): GradleRunner = defaultRunner(*args) + .withPluginClasspath() } abstract class Kotlin : WithGradleTest() {