From 5f81e66a01fd7641b99f5ea82bb1f2a4220cb863 Mon Sep 17 00:00:00 2001 From: Niklas Baudy Date: Wed, 29 Nov 2023 21:28:38 -0300 Subject: [PATCH] Update plugin codequalitytools to v0.24.0 --- .editorconfig | 11 ++++++++-- build.gradle | 2 +- .../graph/generator/DependencyContainer.kt | 6 ++++-- .../DependencyGraphGeneratorExtension.kt | 20 +++++++++---------- .../graph/generator/ProjectTarget.kt | 1 - .../DependencyGraphGeneratorPluginTest.kt | 14 ++++++------- .../generator/DependencyGraphGeneratorTest.kt | 3 ++- 7 files changed, 32 insertions(+), 25 deletions(-) diff --git a/.editorconfig b/.editorconfig index 1d967e8..8527b5f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,14 @@ [*.{kt,kts}] +ktlint_code_style=intellij_idea indent_size=2 continuation_indent_size=2 -insert_final_newline=true ij_kotlin_allow_trailing_comma=true ij_kotlin_allow_trailing_comma_on_call_site=true -ktlint_disabled_rules=annotation,argument-list-wrapping,spacing-between-declarations-with-annotations,filename +insert_final_newline=true +ktlint_standard_annotation=disabled +ktlint_standard_max-line-length=disabled +ktlint_standard_filename=disabled +ktlint_standard_discouraged-comment-location=disabled +ktlint_standard_class-signature=disabled +ktlint_standard_spacing-between-declarations-with-annotations=disabled +ktlint_experimental=enabled \ No newline at end of file diff --git a/build.gradle b/build.gradle index ddb3a56..0c6739f 100755 --- a/build.gradle +++ b/build.gradle @@ -30,7 +30,7 @@ validatePlugins { codeQualityTools { ktlint { - toolVersion = "0.47.1" + toolVersion = "1.0.1" } detekt { enabled = false diff --git a/src/main/kotlin/com/vanniktech/dependency/graph/generator/DependencyContainer.kt b/src/main/kotlin/com/vanniktech/dependency/graph/generator/DependencyContainer.kt index 747194b..113822a 100644 --- a/src/main/kotlin/com/vanniktech/dependency/graph/generator/DependencyContainer.kt +++ b/src/main/kotlin/com/vanniktech/dependency/graph/generator/DependencyContainer.kt @@ -12,9 +12,11 @@ sealed interface DependencyContainer { data class Project internal constructor( internal val project: GradleProject, - ) : DependencyContainer, GradleProject by project + ) : DependencyContainer, + GradleProject by project data class ResolvedDependency internal constructor( internal val resolvedDependency: GradleResolvedDependency, - ) : DependencyContainer, GradleResolvedDependency by resolvedDependency + ) : DependencyContainer, + GradleResolvedDependency by resolvedDependency } diff --git a/src/main/kotlin/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorExtension.kt b/src/main/kotlin/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorExtension.kt index 65211cd..3766763 100644 --- a/src/main/kotlin/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorExtension.kt +++ b/src/main/kotlin/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorExtension.kt @@ -87,12 +87,12 @@ open class DependencyGraphGeneratorExtension(project: Project) { ) { /** Gradle task name that is associated with this generator. */ @get:Internal val gradleTaskName = "generateDependencyGraph${ - name.replaceFirstChar { - when { - it.isLowerCase() -> it.titlecase(Locale.getDefault()) - else -> it.toString() + name.replaceFirstChar { + when { + it.isLowerCase() -> it.titlecase(Locale.getDefault()) + else -> it.toString() + } } - } }" @get:Internal internal val outputFileName = "dependency-graph${name.toHyphenCase().nonEmptyPrepend("-")}" @get:Internal internal val outputFileNameDot = "$outputFileName.dot" @@ -141,12 +141,12 @@ open class DependencyGraphGeneratorExtension(project: Project) { ) { /** Gradle task name that is associated with this generator. */ @get:Internal val gradleTaskName = "generateProjectDependencyGraph${ - name.replaceFirstChar { - when { - it.isLowerCase() -> it.titlecase(Locale.getDefault()) - else -> it.toString() + name.replaceFirstChar { + when { + it.isLowerCase() -> it.titlecase(Locale.getDefault()) + else -> it.toString() + } } - } }" @get:Internal internal val outputFileName = "project-dependency-graph${name.toHyphenCase().nonEmptyPrepend("-")}" @get:Internal internal val outputFileNameDot = "$outputFileName.dot" diff --git a/src/main/kotlin/com/vanniktech/dependency/graph/generator/ProjectTarget.kt b/src/main/kotlin/com/vanniktech/dependency/graph/generator/ProjectTarget.kt index 90e2ec4..5593522 100644 --- a/src/main/kotlin/com/vanniktech/dependency/graph/generator/ProjectTarget.kt +++ b/src/main/kotlin/com/vanniktech/dependency/graph/generator/ProjectTarget.kt @@ -30,5 +30,4 @@ internal enum class ProjectTarget( ids = emptySet(), color = Color.rgb("#BDBDBD").fill(), ), - ; } diff --git a/src/test/java/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorPluginTest.kt b/src/test/java/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorPluginTest.kt index f6c0c72..2269654 100644 --- a/src/test/java/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorPluginTest.kt +++ b/src/test/java/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorPluginTest.kt @@ -80,14 +80,12 @@ class DependencyGraphGeneratorPluginTest { """.trimMargin(), ) - fun runBuild(): BuildResult { - return GradleRunner.create().withDebug(true) - .withPluginClasspath() - .withGradleVersion(gradleVersion) - .withProjectDir(testProjectDir.root) - .withArguments("generateDependencyGraph", "generateProjectDependencyGraph", "-Dorg.gradle.jvmargs=-Xmx2048m", "--stacktrace") - .build() - } + fun runBuild(): BuildResult = GradleRunner.create().withDebug(true) + .withPluginClasspath() + .withGradleVersion(gradleVersion) + .withProjectDir(testProjectDir.root) + .withArguments("generateDependencyGraph", "generateProjectDependencyGraph", "-Dorg.gradle.jvmargs=-Xmx2048m", "--stacktrace") + .build() val result = runBuild() assertEquals(TaskOutcome.SUCCESS, result.task(":generateDependencyGraph")?.outcome) diff --git a/src/test/java/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorTest.kt b/src/test/java/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorTest.kt index 3582097..5be4cf3 100644 --- a/src/test/java/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorTest.kt +++ b/src/test/java/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorTest.kt @@ -212,7 +212,8 @@ class DependencyGraphGeneratorTest { val dependencyNode: (MutableNode, ResolvedDependency) -> MutableNode = { node, project -> val random = Random(project.name.hashCode().toLong()) node.add( - Style.FILLED, Color.hsv(random.nextDouble(), random.nextDouble(), random.nextDouble()), + Style.FILLED, + Color.hsv(random.nextDouble(), random.nextDouble(), random.nextDouble()), ) }