Closed Bug 1375861 Opened 7 years ago Closed 5 years ago

[mozlint] Automatically exclude 3rd party paths


(Developer Infrastructure :: Lint and Formatting, enhancement, P5)



(firefox64 fixed)

Tracking Status
firefox64 --- fixed


(Reporter: ahal, Assigned: ahal)


(Depends on 1 open bug)



(1 file)

There's a maintained list of third party paths that live in the tree:

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
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 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
Depends on: 1433522
Product: Testing → Firefox Build System
Depends on: moz.yaml
See Also: → 1466902
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
Pushed by
[mozlint] Globally exclude paths listed in tools/rewriting/ThirdPartyPaths.txt from our linters, r=sylvestre
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.