From 22b4a2cf7e7ebeda5ed0953ce5cb810db2a49595 Mon Sep 17 00:00:00 2001 From: Gustavo Pagani Date: Thu, 22 Sep 2022 13:42:25 +0100 Subject: [PATCH] Add twitter compose rules ktlint check --- .github/workflows/build.yml | 3 ++- build.gradle | 4 ++++ gradle/libs.versions.toml | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 438babfeb4..7e8f766549 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,7 +56,8 @@ jobs: run: | ./gradlew --scan --stacktrace \ spotlessCheck \ - lintDebug + lintDebug \ + lintKotlin - name: Unit Tests run: | diff --git a/build.gradle b/build.gradle index 58ba31e0cf..c4e617b1e5 100644 --- a/build.gradle +++ b/build.gradle @@ -36,6 +36,8 @@ buildscript { classpath libs.paparazziPlugin classpath libs.dagger.hiltandroidplugin + + classpath libs.twitter.compose.rules.ktlint } } @@ -47,6 +49,7 @@ plugins { alias(libs.plugins.ksp) apply false alias(libs.plugins.kapt) apply false alias(libs.plugins.protobuf) apply false + alias(libs.plugins.kolinter) apply false } apply plugin: 'org.jetbrains.dokka' @@ -104,6 +107,7 @@ allprojects { subprojects { apply plugin: 'com.diffplug.spotless' + apply plugin: 'org.jmailen.kotlinter' spotless { kotlin { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b3f9ed1b9b..7d84124676 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -30,6 +30,7 @@ googledagger = "2.43.2" gradlePlugin = "7.2.2" io-coil-kt = "2.1.0" junit = "4.13.2" +kolinter = "3.12.0" kotlin = "1.7.0" kotlinxCoroutine = "1.6.4" ksp = "1.7.0-1.0.6" @@ -39,6 +40,7 @@ moshi = "1.13.0" room = "2.4.3" spotless = "6.9.0" truth = "1.1.3" +twitterComposeRulesKtlint = "0.0.13" versionCatalogUpdate = "0.5.3" wearcompose = "1.0.0" @@ -143,6 +145,7 @@ room-common = { module = "androidx.room:room-common", version.ref = "room" } room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" } room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" } truth = { module = "com.google.truth:truth", version.ref = "truth" } +twitter-compose-rules-ktlint = { module = "com.twitter.compose.rules:ktlint", version.ref = "twitterComposeRulesKtlint" } wearcompose-foundation = { module = "androidx.wear.compose:compose-foundation", version.ref = "wearcompose" } wearcompose-material = { module = "androidx.wear.compose:compose-material", version.ref = "wearcompose" } wearcompose-navigation = { module = "androidx.wear.compose:compose-navigation", version.ref = "wearcompose" } @@ -150,6 +153,7 @@ wearcompose-navigation = { module = "androidx.wear.compose:compose-navigation", [plugins] benManes = { id = "com.github.ben-manes.versions", version.ref = "benManes" } kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } +kolinter = { id = "org.jmailen.kotlinter", version.ref = "kolinter" } kotlinGradle = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }