From 53476f612b3cfef292717d18dd54ca82d9e0baa3 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 1 Jun 2023 18:24:45 +0530 Subject: feat: add `slack-lint-checks` --- .../src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt | 8 ++++---- .../src/main/kotlin/app/passwordstore/gradle/LintConfig.kt | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'build-logic/src') 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()?.run { lint.configureLint(project) } project.extensions.findByType()?.run { lint.configureLint(project) } + val lintDepKeys = listOf("thirdparty-compose-lints", "thirdparty-slack-lints") val catalog = project.extensions.getByType() 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") } -- cgit v1.2.3