diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2023-06-01 18:24:45 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2023-06-04 01:52:57 +0530 |
commit | 53476f612b3cfef292717d18dd54ca82d9e0baa3 (patch) | |
tree | 74dbd19e35c3ea5fadb30bf04f2295391aed6f64 | |
parent | 59dc6d27ded6f107655824747c021dedffd4f4b7 (diff) |
feat: add `slack-lint-checks`
-rw-r--r-- | build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt | 8 | ||||
-rw-r--r-- | build-logic/src/main/kotlin/app/passwordstore/gradle/LintConfig.kt | 7 | ||||
-rw-r--r-- | gradle/libs.versions.toml | 1 |
3 files changed, 12 insertions, 4 deletions
diff --git a/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt b/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt index d73239c2..f3fe5a95 100644 --- a/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt +++ b/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt @@ -47,11 +47,11 @@ object AndroidCommon { } project.extensions.findByType<ApplicationExtension>()?.run { lint.configureLint(project) } project.extensions.findByType<LibraryExtension>()?.run { lint.configureLint(project) } + val lintDepKeys = listOf("thirdparty-compose-lints", "thirdparty-slack-lints") val catalog = project.extensions.getByType<VersionCatalogsExtension>() val libs = catalog.named("libs") - project.dependencies.addProvider( - "lintChecks", - libs.findLibrary("thirdparty-compose-lints").get() - ) + lintDepKeys.forEach { key -> + project.dependencies.addProvider("lintChecks", libs.findLibrary(key).get()) + } } } 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 de63c580..361b92cd 100644 --- a/build-logic/src/main/kotlin/app/passwordstore/gradle/LintConfig.kt +++ b/build-logic/src/main/kotlin/app/passwordstore/gradle/LintConfig.kt @@ -29,8 +29,15 @@ object LintConfig { // False-positives abound due to use of ViewBinding disable += "UnusedIds" if (!isJVM) { + // Enable compose-lint-checks' Material 2 detector enable += "ComposeM2Api" error += "ComposeM2Api" + // slack-lint-checks' checker for deprecations is useless to me + disable += "DeprecatedCall" + // Hilt only does field injection for fragments + disable += "FragmentFieldInjection" + // Too pedantic + disable += "ArgInFormattedQuantityStringRes" } baseline = project.file("lint-baseline.xml") } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 269e4111..74a3734f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -94,6 +94,7 @@ thirdparty-nonfree-googlePlayAuthApiPhone = "com.google.android.gms:play-service thirdparty-nonfree-sentry = "io.sentry:sentry-android:6.21.0" thirdparty-pgpainless = "org.pgpainless:pgpainless-core:1.5.1" thirdparty-plumber = { module = "com.squareup.leakcanary:plumber-android-startup", version.ref = "leakcanary" } +thirdparty-slack-lints = "com.slack.lint:slack-lint-checks:0.3.0" # TODO: Remove the explicit bcpkix dependency when upgrading this to a BC 1.71 compatible version thirdparty-sshj = "com.hierynomus:sshj:0.35.0" thirdparty-uri = "com.eygraber:uri-kmp:0.0.11" |