diff --git a/build-logic/convention/src/main/kotlin/HedvigLintConventionPlugin.kt b/build-logic/convention/src/main/kotlin/HedvigLintConventionPlugin.kt index bc6f7496c7..7f4995a312 100644 --- a/build-logic/convention/src/main/kotlin/HedvigLintConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/HedvigLintConventionPlugin.kt @@ -57,7 +57,10 @@ class HedvigLintConventionPlugin : Plugin { } private fun Lint.configure(lintXmlFile: File, lintBaselineFile: File) { - baseline = lintBaselineFile + // Lint aborts the build whenever it has to create a baseline, even when it found nothing to put in + // one, and the baseline it leaves behind then suppresses real errors on the next run. A module opts + // in by committing the file: create it empty, then fill it with `updateLintBaseline`. + baseline = lintBaselineFile.takeIf(File::exists) lintConfig = lintXmlFile xmlReport = true } diff --git a/hedvig-lint/lint.xml b/hedvig-lint/lint.xml index 5152aacc2b..036ff3c1f0 100644 --- a/hedvig-lint/lint.xml +++ b/hedvig-lint/lint.xml @@ -8,6 +8,12 @@ config entry for a check absent from a given module isn't flagged. --> + + + +