summaryrefslogtreecommitdiff
path: root/build-logic/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'build-logic/src/main')
-rw-r--r--build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt9
-rw-r--r--build-logic/src/main/kotlin/app/passwordstore/gradle/LintConfig.kt33
2 files changed, 34 insertions, 8 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 ca324ccf..04a2dc7a 100644
--- a/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt
+++ b/build-logic/src/main/kotlin/app/passwordstore/gradle/AndroidCommon.kt
@@ -1,9 +1,9 @@
package app.passwordstore.gradle
+import app.passwordstore.gradle.LintConfig.configureLint
import app.passwordstore.gradle.flavors.configureSlimTests
import com.android.build.api.dsl.ApplicationExtension
import com.android.build.api.dsl.LibraryExtension
-import com.android.build.api.dsl.Lint
import com.android.build.gradle.TestedExtension
import org.gradle.api.JavaVersion
import org.gradle.api.Project
@@ -58,10 +58,3 @@ object AndroidCommon {
project.extensions.findByType<LibraryExtension>()?.run { lint.configureLint(project) }
}
}
-
-private fun Lint.configureLint(project: Project) {
- abortOnError = false
- checkReleaseBuilds = false
- warningsAsErrors = false
- baseline = project.file("lint-baseline.xml")
-}
diff --git a/build-logic/src/main/kotlin/app/passwordstore/gradle/LintConfig.kt b/build-logic/src/main/kotlin/app/passwordstore/gradle/LintConfig.kt
new file mode 100644
index 00000000..41bb781f
--- /dev/null
+++ b/build-logic/src/main/kotlin/app/passwordstore/gradle/LintConfig.kt
@@ -0,0 +1,33 @@
+package app.passwordstore.gradle
+
+import com.android.build.api.dsl.Lint
+import org.gradle.api.Project
+
+object LintConfig {
+ fun Lint.configureLint(project: Project) {
+ quiet = project.providers.environmentVariable("CI").isPresent
+ abortOnError = true
+ checkReleaseBuilds = true
+ warningsAsErrors = true
+ ignoreWarnings = false
+ checkAllWarnings = true
+ noLines = false
+ showAll = true
+ explainIssues = true
+ textReport = false
+ xmlReport = false
+ htmlReport = true
+ sarifReport = true
+ // Noisy, not particularly actionable
+ disable += "DuplicateStrings"
+ // We deal with dependency upgrades separately
+ disable += "NewerVersionAvailable"
+ // Noisy
+ disable += "SyntheticAccessor"
+ // Noisy, not particularly actionable
+ disable += "TypographyQuotes"
+ // False-positives abound due to use of ViewBinding
+ disable += "UnusedIds"
+ baseline = project.file("lint-baseline.xml")
+ }
+}