[mozlint] Automatically exclude 3rd party paths

RESOLVED FIXED in Firefox 64

Status

enhancement
P5
normal
RESOLVED FIXED
2 years ago
8 months ago

People

(Reporter: ahal, Assigned: ahal)

Tracking

(Depends on 2 bugs)

unspecified
mozilla64
Dependency tree / graph

Firefox Tracking Flags

(firefox64 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

2 years ago
There's a maintained list of third party paths that live in the tree:
https://dxr.mozilla.org/mozilla-central/source/tools/rewriting/ThirdPartyPaths.txt

Mozlint could read this file and automatically exclude all those paths from its path filtering mechanism. We'd probably need to add an --exclude-file argument to mozlint.
We probably want to combine this with bug 1366714 - at least for ESLint. Mainly so that we can get editor integration supported as well.
Severity: normal → enhancement
Depends on: 1366714
Priority: -- → P5
Assignee

Comment 2

Last year
So tools/rewriting/ThirdPartyPaths.txt is meant to list all 3rd party modules. E.g, if a new module is added to /third_party, we need to remember to explicitly update the list, or it will be missed. I think it's serving a different purpose than what mozlint needs.

I think this would be a perfect application for the Files Metadata system in moz.build. We could create rules like:

with Files("third_party/**"):
    THIRD_PARTY = True

I'll file a new bug to get the annotations added that blocks this. Then we can make this bug about getting |mach lint| to query 3rd party paths and automatically pass them in via the 'exclude' directive. I think this should be handled outside of .eslintignore, because we want these to be excluded for all linters.

Note: we may want to avoid querying this metadata every time. Maybe we can write a mechanism to generate a file of paths to exclude and only re-generate when we need to.
Summary: [mozlint] Automatically exclude paths from /tools/rewriting/ThirdPartyPaths.txt → [mozlint] Automatically exclude 3rd party paths
Assignee

Updated

Last year
Depends on: 1433522

Updated

Last year
Product: Testing → Firefox Build System
Assignee

Updated

Last year
Depends on: moz.yaml
Assignee

Updated

Last year
See Also: → 1466902
Assignee

Comment 3

8 months ago
While the moz.yaml proposal this depends on would be a better solution, let's just exclude ThirdPartyPaths.txt for now. We can switch to whatever new mechanism we come up with later.
Assignee: nobody → ahal
Status: NEW → ASSIGNED

Comment 5

8 months ago
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1635530c393a
[mozlint] Globally exclude paths listed in tools/rewriting/ThirdPartyPaths.txt from our linters, r=sylvestre

Comment 6

8 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/1635530c393a
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.