Skip to content

Commit 17df894

Browse files
committed
Fjerner spotless til fordel for org.jlleitschuh.gradle.ktlint plugin
1 parent 4c7c726 commit 17df894

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

buildSrc/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
`kotlin-dsl`
3-
id("com.diffplug.spotless") version "6.25.0"
3+
id("org.jlleitschuh.gradle.ktlint") version "12.2.0"
44
}
55

66
repositories {
@@ -10,5 +10,5 @@ repositories {
1010

1111
dependencies {
1212
implementation(kotlin("gradle-plugin"))
13-
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0")
13+
implementation("org.jlleitschuh.gradle:ktlint-gradle:12.1.2")
1414
}
Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
2-
import org.gradle.api.tasks.testing.logging.TestLogEvent
32
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
import org.gradle.api.tasks.testing.logging.TestLogEvent
44

55
plugins {
66
kotlin("jvm")
7-
id("com.diffplug.spotless")
7+
id("org.jlleitschuh.gradle.ktlint")
88
}
99

1010
repositories {
1111
mavenCentral()
12-
maven("https://www.jitpack.io")
12+
maven("https://github-package-registry-mirror.gc.nav.no/cached/maven-release")
13+
maven("https://jitpack.io")
1314
}
1415

1516
dependencies {
17+
implementation(platform(kotlin("bom")))
18+
implementation(kotlin("stdlib-jdk8"))
1619
testImplementation(kotlin("test"))
1720
}
1821

@@ -30,17 +33,6 @@ tasks.test {
3033
}
3134
}
3235

33-
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
34-
kotlin {
35-
ktlint()
36-
targetExclude("build/generated/**")
37-
}
38-
39-
kotlinGradle {
40-
ktlint()
41-
}
42-
}
43-
4436
tasks.withType<KotlinCompile>().configureEach {
45-
dependsOn("spotlessApply")
37+
dependsOn("ktlintFormat")
4638
}

dp-inntekt-api/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ tasks.named("graphqlGenerateClient") {
109109
dependsOn("downloadPdlSDL")
110110
}
111111

112+
ktlint {
113+
filter {
114+
exclude { element -> element.file.path.contains("generated/") }
115+
}
116+
}
117+
112118
val Project.buildDir_: File get() = layout.buildDirectory.get().asFile
113119
val schema = "schema.graphql"
114120

0 commit comments

Comments
 (0)