Skip to content

Commit

Permalink
Bump org.jmailen.kotlinter from 4.3.0 to 4.4.0 (#387)
Browse files Browse the repository at this point in the history
* 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] <[email protected]>

* lint fixes

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Mailen <[email protected]>
  • Loading branch information
dependabot[bot] and jeremymailen authored Jul 14, 2024
1 parent 3990bad commit e544701
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 32 deletions.
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.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" }
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

0 comments on commit e544701

Please sign in to comment.