re-enable linting for excluded firefox-android files after migration to m-c
Categories
(Fenix :: General, task, P3)
Tracking
(firefox129 fixed)
Tracking | Status | |
---|---|---|
firefox129 | --- | fixed |
People
(Reporter: jcristau, Assigned: gbrown)
References
(Blocks 1 open bug)
Details
Attachments
(8 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
In bug 1825116, for expediency we're excluding some firefox-android files from the normal mach lint tasks.
After the merge we need to go back and figure out what needs to be fixed or excluded via things like Generated.txt or ThirdPartyPaths.txt.
![]() |
Assignee | |
Updated•11 months ago
|
![]() |
Assignee | |
Comment 1•11 months ago
|
||
![]() |
Assignee | |
Comment 2•11 months ago
|
||
![]() |
Assignee | |
Comment 3•11 months ago
|
||
![]() |
Assignee | |
Updated•11 months ago
|
![]() |
||
Comment 5•11 months ago
|
||
bugherder |
Comment 7•11 months ago
|
||
bugherder |
![]() |
Assignee | |
Comment 8•11 months ago
|
||
![]() |
Assignee | |
Comment 9•11 months ago
|
||
We have many entries in license.yml to avoid missing-license lint errors on android resource files:
https://searchfox.org/mozilla-central/rev/1f27a4022f9f1269d897526c1c892a57743e650c/tools/lint/license.yml#48
Files like https://searchfox.org/mozilla-central/source/mobile/android/android-components/components/browser/engine-system/src/main/res/values-an/strings.xml are maintained in the android-l10n repo and imported into mozilla-central by automation. As such, I think it is appropriate for those paths to actually be in Generated.txt. However, if those paths are added to Generated.txt and removed from license.yml, the license linter tries to lint those paths (and reports many failures). Is that expected? Should paths be added to Generated.txt and duplicated in license.yml?
![]() |
Assignee | |
Comment 10•11 months ago
|
||
Comment 11•11 months ago
|
||
(In reply to Geoff Brown [:gbrown] (pto Apr 11-18) from comment #9)
We have many entries in license.yml to avoid missing-license lint errors on android resource files:
https://searchfox.org/mozilla-central/rev/1f27a4022f9f1269d897526c1c892a57743e650c/tools/lint/license.yml#48Files like https://searchfox.org/mozilla-central/source/mobile/android/android-components/components/browser/engine-system/src/main/res/values-an/strings.xml are maintained in the android-l10n repo and imported into mozilla-central by automation. As such, I think it is appropriate for those paths to actually be in Generated.txt. However, if those paths are added to Generated.txt and removed from license.yml, the license linter tries to lint those paths (and reports many failures). Is that expected? Should paths be added to Generated.txt and duplicated in license.yml?
It looks like there's something wrong with either the license generator or how Generated.txt
is working.
If I don't change license.yml
but add mobile/android/android-components/components/**/src/main/res/**/
to the list in Generated.txt
, then I start getting lots of errors. It seems to then ignore the mobile/android/**/build
entry.
I think we should file fixing that as a separate bug under Developer Infrastructure: Lint and Formatting. We'll probably need a linter fix, so let's handle the license part there.
Comment 12•11 months ago
|
||
Comment 13•11 months ago
|
||
bugherder |
![]() |
||
Comment 14•11 months ago
|
||
bugherder |
Comment 15•10 months ago
|
||
Note: marking this as P3 because it might take a while, but as of now, Geoff expects to be working on it continuously.
Comment 16•10 months ago
|
||
Comment 17•10 months ago
|
||
bugherder |
Updated•10 months ago
|
Comment 18•10 months ago
|
||
Comment 19•10 months ago
|
||
bugherder |
![]() |
Assignee | |
Comment 20•10 months ago
|
||
Cleanup license.yml by:
- adding license headers to gradle.properties: some gradle.properties files already have
license headers; I have just copied those headers to files where they were missing - adding license headers for a few .xml files
- moving the .../src/main/res/ exclusions to Generated.txt; these exclusions are primarily
needed for the strings.xml files, which are updated from the android-l10n repo, so they
seem more appropriate for Generated.txt
![]() |
Assignee | |
Comment 21•10 months ago
|
||
(In reply to Mark Banner (:standard8) from comment #11)
I think we should file fixing that as a separate bug under Developer Infrastructure: Lint and Formatting. We'll probably need a linter fix, so let's handle the license part there.
Filed bug 1895746 for this.
Comment 22•10 months ago
|
||
Comment 23•10 months ago
|
||
bugherder |
![]() |
Assignee | |
Comment 24•10 months ago
|
||
This eliminates some eslint errors on firefox-android code by running 'mach lint --linter=eslint --fix'.
The eslint --fix only addresses a few simple issues, but this allows us to remove some lint exclusions.
Comment 25•10 months ago
|
||
Comment 26•10 months ago
|
||
bugherder |
![]() |
Assignee | |
Comment 27•9 months ago
|
||
Thanks for all your reviews and help with this bug!
Now "only" a small section of eslint exclusions remain: https://searchfox.org/mozilla-central/rev/f5251f16058e6307d92da02eed07ee91b9ee6243/.eslintignore#197-211
If those exclusions are removed, these eslint errors are produced: https://treeherder.mozilla.org/logviewer?job_id=459421658&repo=try&lineNumber=545
I'm not familiar with this code, nor do I have much experience with javascript in general. Any advice or suggestions for how to resolve these?
![]() |
Assignee | |
Comment 28•9 months ago
|
||
wip with a quick fix for no-console
and no-unused-vars
:
https://treeherder.mozilla.org/jobs?repo=try&revision=c3051bf93c64265962eeb2cebf8664db6bbc034e
Most of the remaining issues are no-undef
and no-unsanitized/property
.
Comment 29•9 months ago
|
||
(In reply to Geoff Brown [:gbrown] (pto, back Jun 10) from comment #27)
If those exclusions are removed, these eslint errors are produced: https://treeherder.mozilla.org/logviewer?job_id=459421658&repo=try&lineNumber=545
[task 2024-05-23T22:02:46.820Z] TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/mobile/android/android-components/components/browser/icons/src/main/assets/extensions/browser-icons/icons.js:28:38 | 'currentIndex' is defined but never used. Allowed unused args must match /^_/u. (no-unused-vars)
Remove second + third arg (x3)
[task 2024-05-23T22:02:46.820Z] TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/mobile/android/android-components/components/feature/accounts/src/main/assets/extensions/fxawebchannel/background.js:9:12 | 'browser' is not defined. (no-undef)
Add /* eslint-env webextensions */
at the top of the file. (same for fxawebchannel.js, readerview-background.js, readerview-content.js, readerview.js)
[task 2024-05-23T22:02:46.820Z] TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/mobile/android/android-components/components/feature/readerview/src/main/assets/extensions/readerview/readerview.js:44:22 | 'Readability' is not defined. (no-undef)
Also add:
/* import-globals-from readability/readability-0.4.2.js */
/* import-globals-from readability/JSDOMParser-0.4.2.js */
Updated•9 months ago
|
![]() |
Assignee | |
Updated•9 months ago
|
![]() |
Assignee | |
Comment 30•8 months ago
|
||
![]() |
Assignee | |
Updated•8 months ago
|
Comment 31•8 months ago
|
||
Comment 32•8 months ago
|
||
bugherder |
Description
•