Skip to content

Commit 740363d

Browse files
authored
Merge pull request #2211 from Netflix/reenable-ktlint
re-enable ktlint by switching to ktlint-gradle
2 parents 06b7ad4 + 9a43a58 commit 740363d

File tree

14 files changed

+23
-32
lines changed

14 files changed

+23
-32
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ don't miss any language features of newer Java releases while supporting a broad
9393
Code conventions
9494
-----
9595
We use the standard Kotlin coding conventions. Intellij should select the correct style automatically because we checked
96-
in the `.idea/codeStyle` folder. Furthermore, we're also using [Kotlinter](https://plugins.gradle.org/plugin/org.jmailen.kotlinter). You can run formatting manually using Gradle:
96+
in the `.idea/codeStyle` folder as well as defined rules in `.editorconfig`. Furthermore, we're also using [ktlint-gradle](https://github.com/JLLeitschuh/ktlint-gradle). You can run formatting manually using Gradle:
9797

9898
```bash
99-
./gradlew lintKotlin # lint kotlin sources
100-
./gradlew :graphql-dgs-extended-validation:lintKotlin # lint kotlin sources for a single module
101-
./gradlew formatKotlin # format Kotlin Sources
99+
./gradlew ktlintCheck # lint kotlin sources
100+
./gradlew :graphql-dgs-extended-validation:ktlintCheck # lint kotlin sources for a single module
101+
./gradlew ktlintFormat # format Kotlin Sources
102102
```
103103

104104
We recommend installing a Git push hook to run the style check to prevent failing the build for your branch.

build.gradle.kts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ plugins {
2828

2929
id("nebula.netflixoss") version "11.6.0"
3030
id("io.spring.dependency-management") version "1.1.7"
31-
32-
// id("org.jmailen.kotlinter") version "5.2.+"
31+
id("org.jlleitschuh.gradle.ktlint") version "13.1.0"
3332
id("me.champeau.jmh") version "0.7.3"
3433

3534
kotlin("jvm") version Versions.KOTLIN_VERSION
@@ -57,16 +56,16 @@ allprojects {
5756
val internalBomModules by extra(
5857
listOf(
5958
project(":graphql-dgs-platform"),
60-
project(":graphql-dgs-platform-dependencies")
61-
)
59+
project(":graphql-dgs-platform-dependencies"),
60+
),
6261
)
6362

6463
configure(subprojects.filterNot { it in internalBomModules }) {
6564

6665
apply {
6766
plugin("java-library")
6867
plugin("kotlin")
69-
// plugin("org.jmailen.kotlinter")
68+
plugin("org.jlleitschuh.gradle.ktlint")
7069
plugin("me.champeau.jmh")
7170
plugin("io.spring.dependency-management")
7271
}
@@ -77,7 +76,7 @@ configure(subprojects.filterNot { it in internalBomModules }) {
7776
dependencyManagement {
7877
imports {
7978
mavenBom("org.jetbrains.kotlin:kotlin-bom:${Versions.KOTLIN_VERSION}")
80-
mavenBom("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")
79+
mavenBom("org.springframework.boot:spring-boot-dependencies:$springBootVersion")
8180
}
8281
}
8382

@@ -89,8 +88,8 @@ configure(subprojects.filterNot { it in internalBomModules }) {
8988
// Please refer to the following links for further reference.
9089
// * https://github.com/melix/jmh-gradle-plugin
9190
// * https://openjdk.java.net/projects/code-tools/jmh/
92-
jmh("org.openjdk.jmh:jmh-core:${jmhVersion}")
93-
jmh("org.openjdk.jmh:jmh-generator-annprocess:${jmhVersion}")
91+
jmh("org.openjdk.jmh:jmh-core:$jmhVersion")
92+
jmh("org.openjdk.jmh:jmh-generator-annprocess:$jmhVersion")
9493

9594
testImplementation("org.springframework.boot:spring-boot-starter-test") {
9695
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
@@ -140,12 +139,8 @@ configure(subprojects.filterNot { it in internalBomModules }) {
140139
kotlin {
141140
jvmToolchain(17)
142141
compilerOptions {
143-
javaParameters = true
142+
javaParameters = true
144143
freeCompilerArgs.addAll("-Xjvm-default=all-compatibility", "-java-parameters")
145144
}
146145
}
147-
148-
// kotlinter {
149-
// reporters = arrayOf("checkstyle", "plain")
150-
// }
151146
}

dgs-starter-test/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@
1717
dependencies {
1818
api(project(":graphql-dgs-spring-graphql-test"))
1919
api("org.springframework.graphql:spring-graphql-test")
20-
21-
}
20+
}

dgs-starter/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
1817
dependencies {
1918
api(project(":graphql-dgs-spring-graphql"))
2019
api(project(":graphql-dgs-client"))
2120
api(project(":graphql-dgs-reactive"))
2221
api(project(":graphql-error-types"))
2322
api("org.springframework.boot:spring-boot-starter-graphql")
24-
}
23+
}

graphql-dgs-client/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ dependencies {
4343

4444
tasks.withType<JavaCompile>().configureEach {
4545
options.compilerArgs.addAll(listOf("--patch-module", "com.netflix.graphql.dgs.client=${sourceSets["main"].output.asPath}"))
46-
}
46+
}

graphql-dgs-extended-scalars/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ dependencies {
2525

2626
tasks.withType<JavaCompile>().configureEach {
2727
options.compilerArgs.addAll(listOf("--patch-module", "com.netflix.graphql.dgs.extendedscalars=${sourceSets["main"].output.asPath}"))
28-
}
28+
}

graphql-dgs-reactive/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ dependencies {
2727

2828
tasks.withType<JavaCompile>().configureEach {
2929
options.compilerArgs.addAll(listOf("--patch-module", "com.netflix.graphql.dgs.reactive=${sourceSets["main"].output.asPath}"))
30-
}
30+
}

graphql-dgs-spring-boot-micrometer/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ dependencies {
1717

1818
tasks.withType<JavaCompile>().configureEach {
1919
options.compilerArgs.addAll(listOf("--patch-module", "com.netflix.graphql.dgs.micrometer=${sourceSets["main"].output.asPath}"))
20-
}
20+
}

graphql-dgs-spring-graphql-starter-test/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
*/
2121
dependencies {
2222
api(project(":dgs-starter-test"))
23-
}
23+
}

graphql-dgs-spring-graphql-starter/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
*/
2121
dependencies {
2222
api(project(":dgs-starter"))
23-
}
23+
}

0 commit comments

Comments
 (0)