Enforce lint cleanliness when building (#3363)

* Enforce lint cleanliness when building

The volume of lintable issues is growing. To stem the tide:

1. Add `app/lint-baseline.xml`, which contains the current set of lint issues.
   Any issue appearing here will not cause the build to fail.

2. Move lint configuration settings in to `lint.xml`.

3. Update the lint configuration so that any issue (i.e., any issue not
   in lint-baseline.xml) causes a build failure.

4. Add the lint tasks as depedency when assembling an APK, to ensure the
   lint checks are run.

* lint: Convert launcher images to webp

* Move lint.xml location

* Don't lint when assembling

* Update baseline
This commit is contained in:
Nik Clayton 2023-03-13 10:23:42 +01:00 committed by GitHub
parent 6dfdaec425
commit 3ff8f73246
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 8994 additions and 1 deletions

View File

@ -58,8 +58,12 @@ android {
}
lint {
disable 'MissingTranslation'
lintConfig file("lint.xml")
// Regenerate by deleting app/lint-baseline.xml, then run:
// ./gradlew lintBlueDebug
baseline = file("lint-baseline.xml")
}
buildFeatures {
buildConfig true
resValues true

8957
app/lint-baseline.xml Normal file

File diff suppressed because one or more lines are too long

32
app/lint.xml Normal file
View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2023 Tusky Contributors
~
~ This file is a part of Tusky.
~
~ This program is free software; you can redistribute it and/or modify it under the terms of the
~ GNU General Public License as published by the Free Software Foundation; either version 3 of the
~ License, or (at your option) any later version.
~
~ Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
~ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
~ Public License for more details.
~
~ You should have received a copy of the GNU General Public License along with Tusky; if not,
~ see <http://www.gnu.org/licenses>.
-->
<lint>
<!-- Missing translations are OK -->
<issue id="MissingTranslation" severity="ignore" />
<!-- Duplicate strings are OK. This can happen when e.g., "favourite" appears as both
a noun and a verb -->
<issue id="DuplicateStrings" severity="ignore" />
<!-- Ensure we are warned about errors in the baseline -->
<issue id="LintBaseline" severity="warning" />
<!-- Mark all other lint issues as errors -->
<issue id="all" severity="error" />
</lint>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB