Open Bug 1807330 Opened 1 year ago Updated 6 months ago

Remove suppressed `UnusedResources` warnings in lint baseline file

Categories

(Fenix :: Performance, task)

All
Android
task

Tracking

(Performance Impact:none)

Performance Impact none

People

(Reporter: cpeterson, Unassigned)

Details

From github: https://github.com/mozilla-mobile/fenix/issues/20634.

In #7436, we changed the severity of the UnusedResources Android Lint check to error to prevent additional unused resources from making it into the app and increasing the APK size. In order to do this, we added existing errors to the baseline file, preventing Android Lint from warning us about these unused resources. We should go through the lint baseline file and remove the unused resources. There is one exception: please read this document before removing strings: they interact with our localization process in special ways so we can't just remove them.

For example, the steps to do this might look like:

  • Open app/lint-baseline.xml and search for id="UnusedResources". For each error…
  • Find the location of the unused resource (it's in the <issue... tag)
  • Verify if it's unused (e.g. see if there's a reference to the file in our android-components library via our search tool: https://searchfox.org/mozilla-mobile/source/)
  • If it's unused, remove it. If it's used, add a suppression to the warning near the the call site
  • Remove the corresponding <issue...> tag in app/lint-baseline.xml

We should also consider automating part of this using the IDE "Remove unused resources..." action (hit shift 3 times, then type "remove unused resources"). It may not work correctly with the lint baseline file in place though (or might have a slightly different name).

Some notes:

  • you don't have to fix all the unused errors to make a meaningful PR: fix a few, open a PR, and repeat if you'd like
  • if possible, try to keep the commits small: large commits are more difficult to review. Thanks for your help!

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

The severity field is not set for this bug.
:cpeterson, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(cpeterson)
Flags: needinfo?(cpeterson)
Performance Impact: --- → none
Severity: -- → N/A
Type: defect → task
You need to log in before you can comment on or make changes to this bug.