From 1aaf2f6c13105a8ce8d6e52acb0e021d4413b7da Mon Sep 17 00:00:00 2001 From: stylianosgakis Date: Thu, 3 Sep 2026 09:36:35 +0200 Subject: [PATCH 1/2] chore: only set the lint baseline when the module has one Lint aborts the build whenever it has to create a baseline, and it does so even when it found nothing to put in one. Every module the lint convention plugin touches was therefore required to carry a checked-in baseline, so adding any new module failed `./gradlew lint` with a message that names neither the module nor the reason. Worse, the baseline lint leaves behind on that first run records whatever it found, so a re-run passes and any real error in the new module is suppressed from then on. Pointing `baseline` at the file only when it exists removes both problems. Modules that suppress findings today keep their baseline and behave exactly as before, and a module without one simply reports its findings. --- .../convention/src/main/kotlin/HedvigLintConventionPlugin.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 } From 722e7094d34e261eea8bd4d00504b2bbdf5e5858 Mon Sep 17 00:00:00 2001 From: stylianosgakis Date: Wed, 2 Sep 2026 14:55:09 +0200 Subject: [PATCH 2/2] chore: stop lint from reporting version catalog staleness Renovate owns dependency freshness in this repo, so lint's GradleDependency and NewerVersionAvailable notices are duplicate signal that nobody acts on. They resolve against the shared root gradle/libs.versions.toml rather than the module being linted, so they report identically regardless of which module runs lint, and :hedvig-ktlint surfaced 77 of them for dependencies it does not declare. --- hedvig-lint/lint.xml | 6 ++++++ 1 file changed, 6 insertions(+) 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. --> + + + +