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

Bump org.jmailen.kotlinter from 4.3.0 to 4.4.0 #387

Merged
merged 2 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ junit = "5.10.2"
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" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Unit> = ConcurrentHashMap()
private val lintErrorReports: ConcurrentMap<String, ConcurrentSkipListSet<KtlintCliError>> = ConcurrentHashMap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -51,12 +48,10 @@ internal inline fun <reified K, reified V> ObjectFactory.mapProperty(default: Ma
set(default)
}

inline fun <reified T : Throwable> Throwable.workErrorCauses(): List<Throwable> {
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 <reified T : Throwable> Throwable.workErrorCauses(): List<Throwable> = 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()
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading