diff --git a/app/lint-baseline.xml b/app/lint-baseline.xml
index e0ce60730..d599da9df 100644
--- a/app/lint-baseline.xml
+++ b/app/lint-baseline.xml
@@ -128,6 +128,17 @@
column="4"/>
+
+
+
+
()?.run { lint.configureLint(project) }
project.extensions.findByType()?.run { lint.configureLint(project) }
+ val catalog = project.extensions.getByType()
+ val libs = catalog.named("libs")
+ project.dependencies.addProvider(
+ "lintChecks",
+ libs.findLibrary("thirdparty-compose-lints").get()
+ )
}
}
diff --git a/build-logic/src/main/kotlin/app/passwordstore/gradle/KotlinJVMLibrary.kt b/build-logic/src/main/kotlin/app/passwordstore/gradle/KotlinJVMLibrary.kt
index 253c7aed6..c5cf84a06 100644
--- a/build-logic/src/main/kotlin/app/passwordstore/gradle/KotlinJVMLibrary.kt
+++ b/build-logic/src/main/kotlin/app/passwordstore/gradle/KotlinJVMLibrary.kt
@@ -23,6 +23,6 @@ class KotlinJVMLibrary : Plugin {
apply(LintPlugin::class)
apply(KotlinCommonPlugin::class)
}
- project.extensions.configure { configureLint(project) }
+ project.extensions.configure { configureLint(project, isJVM = true) }
}
}
diff --git a/build-logic/src/main/kotlin/app/passwordstore/gradle/LintConfig.kt b/build-logic/src/main/kotlin/app/passwordstore/gradle/LintConfig.kt
index 41bb781fc..de63c5803 100644
--- a/build-logic/src/main/kotlin/app/passwordstore/gradle/LintConfig.kt
+++ b/build-logic/src/main/kotlin/app/passwordstore/gradle/LintConfig.kt
@@ -4,7 +4,7 @@ import com.android.build.api.dsl.Lint
import org.gradle.api.Project
object LintConfig {
- fun Lint.configureLint(project: Project) {
+ fun Lint.configureLint(project: Project, isJVM: Boolean = false) {
quiet = project.providers.environmentVariable("CI").isPresent
abortOnError = true
checkReleaseBuilds = true
@@ -28,6 +28,10 @@ object LintConfig {
disable += "TypographyQuotes"
// False-positives abound due to use of ViewBinding
disable += "UnusedIds"
+ if (!isJVM) {
+ enable += "ComposeM2Api"
+ error += "ComposeM2Api"
+ }
baseline = project.file("lint-baseline.xml")
}
}
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 238133f37..a4c8e4280 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -79,6 +79,7 @@ testing-turbine = "app.cash.turbine:turbine:0.12.3"
thirdparty-bouncycastle-bcpkix = { module = "org.bouncycastle:bcpkix-jdk15to18", version.ref = "bouncycastle" }
thirdparty-bouncycastle-bcprov = { module = "org.bouncycastle:bcprov-jdk15to18", version.ref = "bouncycastle" }
thirdparty-commons_codec = "commons-codec:commons-codec:1.14"
+thirdparty-compose-lints = "com.slack.lint.compose:compose-lint-checks:1.2.0"
thirdparty-eddsa = "net.i2p.crypto:eddsa:0.3.0"
thirdparty-fastscroll = "me.zhanghai.android.fastscroll:library:1.2.0"
thirdparty-flowbinding-android = { module = "io.github.reactivecircus.flowbinding:flowbinding-android", version.ref = "flowbinding" }