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

Migrate to kotlinter and update ktlint to 0.46.1. #1399

Merged
merged 1 commit into from Aug 14, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: gradle/wrapper-validation-action@v1

- name: Check style
run: ./gradlew ktlintCheck
run: ./gradlew lintKotlin

# Check if there has been a binary incompatible change to the API.
# If this change is intentional, run `./gradlew apiDump` and commit the new API files.
Expand Down
18 changes: 13 additions & 5 deletions build.gradle.kts
Expand Up @@ -6,7 +6,6 @@ import com.vanniktech.maven.publish.SonatypeHost.DEFAULT
import kotlinx.validation.ApiValidationExtension
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jlleitschuh.gradle.ktlint.KtlintExtension
import java.net.URL

buildscript {
Expand Down Expand Up @@ -51,11 +50,20 @@ allprojects {
group = project.groupId
version = project.versionName

apply(plugin = "org.jlleitschuh.gradle.ktlint")
apply(plugin = "org.jmailen.kotlinter")

extensions.configure<KtlintExtension> {
version by rootProject.libs.versions.ktlint
disabledRules by setOf("indent", "max-line-length", "parameter-list-wrapping")
kotlinter {
version = rootProject.libs.versions.ktlint
disabledRules = arrayOf(
"annotation",
"argument-list-wrapping",
"filename",
"indent",
"max-line-length",
"parameter-list-wrapping",
"spacing-between-declarations-with-annotations",
"wrapping",
)
}

tasks.withType<DokkaTaskPartial>().configureEach {
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Expand Up @@ -5,14 +5,14 @@ androidx-test = "1.4.0"
compose = "1.2.1"
composeCompiler = "1.3.0"
coroutines = "1.6.4"
ktlint = "0.44.0"
ktlint = "0.46.1"
okhttp = "4.10.0"
okio = "3.2.0"

[plugins]
binaryCompatibility = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.11.0" }
dokka = { id = "org.jetbrains.dokka", version = "1.6.10" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version = "10.3.0" }
ktlint = { id = "org.jmailen.kotlinter", version = "3.11.1" }

[libraries]
gradlePlugin-android = "com.android.tools.build:gradle:7.2.2"
Expand Down
2 changes: 1 addition & 1 deletion test.sh
@@ -1,2 +1,2 @@
#!/bin/bash
./gradlew apiCheck ktlintCheck testDebugUnitTest connectedDebugAndroidTest
./gradlew apiCheck lintKotlin testDebugUnitTest connectedDebugAndroidTest