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

Update dependency org.jlleitschuh.gradle.ktlint to v12 #55

Merged
merged 2 commits into from
Mar 17, 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
7 changes: 3 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -778,13 +778,12 @@ ij_groovy_wrap_chain_calls_after_dot = false
ij_groovy_wrap_long_lines = false

[{*.kt,*.kts}]
# Ktlint specific rules and other overrides from standard rules
ktlint_disabled_rules = no-wildcard-imports
continuation_indent_size = 4
ij_kotlin_indent_size = 4
ij_kotlin_continuation_indent_size = 4

twitter_compose_allowed_composition_locals = LocalIsDarkModeActive
ktlint_code_style = intellij_idea # or android_studio or ktlint_official (default)
ktlint_standard_property-naming = disabled
ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = 2

# Kotlin/IJ rules
ij_smart_tabs = false
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
detekt = "1.23.5"
kotlin = "1.9.23"
ktlintGradle = "11.6.1"
ktlintGradle = "12.1.0"
pluginPublish = "1.2.1"
versionCheck = "0.51.0"
android-lint = "8.3.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import javax.inject.Inject

@Suppress("UnnecessaryAbstractClass", "UndocumentedPublicClass")
abstract class DependencyGraphExtension @Inject constructor(project: Project) {

private val objects = project.objects

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ abstract class DependencyGraphPlugin : Plugin<Project> {
override fun apply(project: Project) {
// Add the extension object
val extension = project.extensions.create(
/* name = */ EXTENSION_NAME,
/* type = */ DependencyGraphExtension::class.java,
/* ...constructionArguments = */ project,
// name =
EXTENSION_NAME,
// type =
DependencyGraphExtension::class.java,
// ...constructionArguments =
project,
)

// Add a task that uses configuration from the extension object
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.github.adityabhaskar.dependencygraph.plugin

import io.github.adityabhaskar.dependencygraph.plugin.ShowLegend.*
import io.github.adityabhaskar.dependencygraph.plugin.core.DrawConfig
import io.github.adityabhaskar.dependencygraph.plugin.core.drawDependencyGraph
import org.gradle.api.DefaultTask
Expand Down Expand Up @@ -30,7 +29,9 @@ enum class Direction(internal val directionString: String) {
* * [Never] will not add a legend to any graph
*/
enum class ShowLegend {
Always, OnlyInRootGraph, Never
Always,
OnlyInRootGraph,
Never,
}

/**
Expand All @@ -57,7 +58,6 @@ enum class ShowLegend {
* * Module nodes are clickable, clicking through to the graph of the respective module
*/
abstract class DependencyGraphTask : DefaultTask() {

init {
group = BasePlugin.BUILD_GROUP
description = "Generates dependency graph files for all local modules in the project."
Expand Down Expand Up @@ -167,7 +167,7 @@ abstract class DependencyGraphTask : DefaultTask() {
// Create graph of all dependencies
val graph = parsedGraph.get()

val showLegend = showLegend.getOrElse(OnlyInRootGraph)
val showLegend = showLegend.getOrElse(ShowLegend.OnlyInRootGraph)
val directionString = graphDirection.getOrElse(Direction.LeftToRight).directionString
val fileName = appendMarkDownIfNeeded(
providedFileName = graphFileName.getOrElse(DEFAULT_GRAPH_FILE_NAME),
Expand Down Expand Up @@ -214,7 +214,10 @@ abstract class DependencyGraphTask : DefaultTask() {
)
}

private fun createGraphUrl(repoUrl: String?, mainBranchName: String?): String? {
private fun createGraphUrl(
repoUrl: String?,
mainBranchName: String?,
): String? {
if (repoUrl == null) {
return null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ internal data class DrawConfig(
val shouldGroupModules: Boolean,
)

@Suppress("LongMethod", "CyclomaticComplexMethod", "CognitiveComplexMethod", "ktlint:indent")
@Suppress(
"LongMethod",
"CyclomaticComplexMethod",
"CognitiveComplexMethod",
"ktlint:standard:indent",
)
/**
* Creates a graph of dependencies for the given project and writes it to a file in the project's
* directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import org.junit.Assert.assertNotNull
import org.junit.Test

class DependencyGraphTest {

@Test
fun `plugin is applied correctly to the project`() {
val project = ProjectBuilder.builder().build()
Expand Down