Closed Bug 1375861 Opened 3 years ago Closed 2 years ago
[mozlint] Automatically exclude 3rd party paths
Bug 1375861 - [mozlint] Globally exclude paths listed in tools/rewriting/ThirdPartyPaths.txt from our linters, r?Sylvestre
46 bytes, text/x-phabricator-request
|Details | Review|
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
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
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
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/1635530c393a [mozlint] Globally exclude paths listed in tools/rewriting/ThirdPartyPaths.txt from our linters, r=sylvestre
You need to log in before you can comment on or make changes to this bug.