diff --git a/.editorconfig b/.editorconfig index 33c065c636..f54bb9dca0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -37,6 +37,8 @@ ktlint_standard_trailing-comma-on-call-site = disabled ktlint_standard_trailing-comma-on-declaration-site = disabled ktlint_standard_try-catch-finally-spacing = disabled ktlint_standard_wrapping = disabled +ktlint_compose_lambda-param-event-trailing = disabled +ktlint_compose_modifier-without-default-check = disabled [gradlew.bat] end_of_line = crlf diff --git a/.gitignore b/.gitignore index 6ed36ac6bd..870b9aa917 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,6 @@ $RECYCLE.BIN/ # Ignore Kotlin compiler sessions /.kotlin /buildSrc/.kotlin + +# Un-ignore ktlint-compose rules +!/ktlint-compose-*-all.jar diff --git a/.idea/ktlint-plugin.xml b/.idea/ktlint-plugin.xml index c18f682501..91883ad66e 100644 --- a/.idea/ktlint-plugin.xml +++ b/.idea/ktlint-plugin.xml @@ -10,6 +10,12 @@ MANUAL + false false + + + + - + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index da4b8752ea..f905cc3030 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,6 +6,8 @@ plugins { `jewel-linting` } +buildscript { dependencies { classpath(libs.ktlint.composeRules) } } + dependencies { sarif(projects.decoratedWindow) sarif(projects.foundation) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 771e75f7cf..b7cab75c44 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -5,11 +5,10 @@ plugins { alias(libs.plugins.kotlinx.serialization) } -val properties = Properties() +val myProperties = Properties() +project.file("../gradle.properties").inputStream().use { myProperties.load(it) } -project.file("../gradle.properties").inputStream().use { properties.load(it) } - -val jdkLevel = properties.getProperty("jdk.level") as String +val jdkLevel = myProperties.getProperty("jdk.level") as String kotlin { jvmToolchain { languageVersion = JavaLanguageVersion.of(jdkLevel) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8787ebe45d..61d49b004f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,6 +14,7 @@ kotlinterGradlePlugin = "4.4.1" kotlinxSerialization = "1.7.3" kotlinxBinaryCompat = "0.16.3" ktfmtGradlePlugin = "0.20.1" +ktlintComposeRules = "0.4.19" poko = "0.17.1" [libraries] @@ -26,6 +27,8 @@ kotlinSarif = { module = "io.github.detekt.sarif4k:sarif4k", version.ref = "kotl kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerialization" } +ktlint-composeRules = { module = "io.nlopez.compose.rules:ktlint", version.ref = "ktlintComposeRules" } + jna-core = { module = "net.java.dev.jna:jna", version.ref = "jna" } intellijPlatform-util-ui = { module = "com.jetbrains.intellij.platform:util-ui", version.ref = "intelliJPlatformBuild" } diff --git a/ktlint-compose-0.4.19-all.jar b/ktlint-compose-0.4.19-all.jar new file mode 100644 index 0000000000..cdb077c1d4 Binary files /dev/null and b/ktlint-compose-0.4.19-all.jar differ