From bec2910ad9a1a86021ac8def9d94f3437bececd3 Mon Sep 17 00:00:00 2001 From: Dmitrii Rubtsov Date: Mon, 20 Nov 2023 18:27:06 +0200 Subject: [PATCH] Update ktlint --- .editorconfig | 16 +++++++++++++--- .../sample/compose/screen/DetailScreen.kt | 2 +- build.gradle.kts | 2 +- .../main/kotlin/com/fragula2/utils/Extensions.kt | 4 +++- gradle.properties | 3 +-- gradle/libs.versions.toml | 4 ++-- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.editorconfig b/.editorconfig index 19c7ed5..211cc8a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,7 +4,17 @@ root = true indent_size = 4 insert_final_newline = false -# noinspection EditorConfigKeyCorrectness +# Ktlint 0.50.0 ktlint_standard_no-wildcard-imports = disabled -# noinspection EditorConfigKeyCorrectness -ktlint_standard_trailing-comma-on-declaration-site = disabled \ No newline at end of file +ktlint_standard_trailing-comma-on-declaration-site = disabled + +# Ktlint 1.0.0 +ktlint_standard_annotation = disabled +ktlint_standard_statement-wrapping = disabled +ktlint_standard_blank-line-before-declaration = disabled +ktlint_standard_no-empty-first-line-in-class-body = disabled +ktlint_standard_multiline-expression-wrapping = disabled +ktlint_standard_string-template-indent = disabled +ktlint_standard_parameter-list-wrapping = disabled +ktlint_standard_function-signature = disabled +ktlint_standard_function-naming = disabled \ No newline at end of file diff --git a/app/src/main/kotlin/com/fragula2/sample/compose/screen/DetailScreen.kt b/app/src/main/kotlin/com/fragula2/sample/compose/screen/DetailScreen.kt index 2e984e3..6b37487 100644 --- a/app/src/main/kotlin/com/fragula2/sample/compose/screen/DetailScreen.kt +++ b/app/src/main/kotlin/com/fragula2/sample/compose/screen/DetailScreen.kt @@ -226,7 +226,7 @@ fun MessageBox( contentDescription = null, modifier = Modifier .padding( - top = 56.dp, // TODO use column instead + top = 56.dp, start = 8.dp, bottom = 8.dp, ) diff --git a/build.gradle.kts b/build.gradle.kts index d03b10f..cbd0d22 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,7 +34,7 @@ dependencies { } } -tasks.register("ktlint") { +tasks.register("ktlintCheck") { group = LifecycleBasePlugin.VERIFICATION_GROUP description = "Check Kotlin code style." classpath = ktlint diff --git a/fragula-core/src/main/kotlin/com/fragula2/utils/Extensions.kt b/fragula-core/src/main/kotlin/com/fragula2/utils/Extensions.kt index 22a268a..a737471 100644 --- a/fragula-core/src/main/kotlin/com/fragula2/utils/Extensions.kt +++ b/fragula-core/src/main/kotlin/com/fragula2/utils/Extensions.kt @@ -37,7 +37,9 @@ internal var ViewPager2.pageOverScrollMode: Int get() = getChildAt(0).overScrollMode @RestrictTo(LIBRARY_GROUP) - set(value) { getChildAt(0).overScrollMode = value } + set(value) { + getChildAt(0).overScrollMode = value + } internal var ViewPager2.pageSwipeDirection: SwipeDirection @RestrictTo(LIBRARY_GROUP) diff --git a/gradle.properties b/gradle.properties index 5770523..0d4ef05 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,5 +24,4 @@ android.useAndroidX=true android.enableJetifier=false android.nonTransitiveRClass=true -kotlin.code.style=official -kapt.incremental.apt=true \ No newline at end of file +kotlin.code.style=official \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ea1a550..55d76d8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -19,7 +19,7 @@ junit = "4.13.2" junit-ext = "1.1.5" test-runner = "1.5.2" test-macrobenchmark = "1.2.1" -ktlint = "0.50.0" +ktlint = "1.0.0" [plugins] android-application = { id = "com.android.application", version.ref = "agp" } @@ -37,7 +37,7 @@ plugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version. kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } material = { module = "com.google.android.material:material", version.ref = "material" } coil = { module = "io.coil-kt:coil", version.ref = "coil" } -ktlint = { module = "com.pinterest:ktlint", version.ref = "ktlint" } +ktlint = { module = "com.pinterest.ktlint:ktlint-cli", version.ref = "ktlint" } androidx-core = { module = "androidx.core:core-ktx", version.ref = "core" } androidx-activity = { module = "androidx.activity:activity-ktx", version.ref = "activity" }