Skip to content

Commit

Permalink
Update plugin codequalitytools to v0.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vanniktech committed Nov 30, 2023
1 parent dbe972a commit 4970f9c
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 25 deletions.
11 changes: 9 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ validatePlugins {

codeQualityTools {
ktlint {
toolVersion = "0.47.1"
toolVersion = "1.0.1"
}
detekt {
enabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ internal enum class ProjectTarget(
ids = emptySet(),
color = Color.rgb("#BDBDBD").fill(),
),
;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
)
}

Expand Down

0 comments on commit 4970f9c

Please sign in to comment.