You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Ensure Lint behaves the same in Debug and Release #8357
Lint behaves differently depending on the build type.
We should ensure that behaves the same in both Debug and Release in order to detect potential issues as soon as possible (e.g. #8356).
In order to accomplish this, we could add a lint check on CI. Run lint with Gradle.
At the moment, CI only includes steps that execute assembleDebug or assembleRelease but those tasks don't run the lint task. Which means that we're not executing lint at all.
The lint task is executed when running build task though.
I checked those assumptions analyzing the dependency tree report of each task generated by Gradle Task Tree.
Do we want to include lint errors on CI?
If so, first we should discuss:
How?
What lint errors make a build to fail?
Release/Debug config?
Please add here or as a comment anything I might have missed.
You can take a snapshot of your project's current set of warnings, and then use the snapshot as a baseline for future inspection runs so that only new issues are reported. The baseline snapshot lets you start using lint to fail the build without having to go back and address all existing issues first.
@Guardiola31337 Thanks for looking into this, I'm all for additional checks that could help us find potential issues earlier.
I like the idea of activating lint using our current baseline as starting point. How does that baseline look like? Is it a XML file that we'd commit to the repo?
to build.gradleand execute lint gradle task so then lint-baseline.xml is created including all lint errors. After that, those errors are ignored:
After you create the baseline, if you add any new warnings to the codebase, lint lists only the newly introduced bugs.
Cool thing is that lint warns/reminds you that one or more issues were filtered out because they were already listed in the baseline. Even if you fix issues included in the file it lets you know that it's a good time to recreate the baseline 👍
Activity
Guardiola31337 commentedon Jun 20, 2017
In order to accomplish this, we could add a
lintcheck on CI. Run lint with Gradle.At the moment, CI only includes steps that execute
assembleDebugorassembleReleasebut those tasks don't run thelinttask. Which means that we're not executing lint at all.The
linttask is executed when runningbuildtask though.I checked those assumptions analyzing the dependency tree report of each task generated by Gradle Task Tree.
Do we want to include lint errors on CI?
If so, first we should discuss:
If we decide so, a great way to gradually introduce lint is to create a warnings baseline so:
@mapbox/android Thoughts?
Guardiola31337 commentedon Jun 20, 2017
Further useful information:
LintOptionszugaldia commentedon Jun 20, 2017
@Guardiola31337 Thanks for looking into this, I'm all for additional checks that could help us find potential issues earlier.
I like the idea of activating lint using our current baseline as starting point. How does that baseline look like? Is it a XML file that we'd commit to the repo?
Guardiola31337 commentedon Jun 20, 2017
@zugaldia
Yeah, you only need to add
to
build.gradleand executelintgradle task so thenlint-baseline.xmlis created including all lint errors. After that, those errors are ignored:Cool thing is that lint warns/reminds you that one or more issues were filtered out because they were already listed in the baseline. Even if you fix issues included in the file it lets you know that it's a good time to recreate the baseline 👍
zugaldia commentedon Jun 20, 2017
@Guardiola31337 🚀
I'd like to see our current baseline. If the resulting file is easily readable we could manually remove items we don't want to whitelist.
Guardiola31337 commentedon Jun 21, 2017
👀 @zugaldia
60 errors were filtered out because they were listed in the baseline file,lint-baseline.xml238 errors were filtered out because they were listed in the baseline file,lint-baseline.xml8 errors and 70 warnings were filtered out because they were listed in the baseline file,lint-baseline.xml