Closed
Bug 1384273
Opened 6 years ago
Closed 6 years ago
Get root of tree from mach when linting.
Categories
(Developer Infrastructure :: Lint and Formatting, defect)
Tracking
(firefox56 fixed)
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: tomprince, Assigned: tomprince)
References
Details
Attachments
(1 file)
I'd like to run `mach lint` in a subdirectory but it default to expecting the current directory as the root of the source tree. `mach` already knows where the root of the tree is, so pass that into lint, rather then letting lint guess.
Comment hidden (mozreview-request) |
Comment 2•6 years ago
|
||
mozreview-review |
Comment on attachment 8890119 [details] Bug 1384273 - Get lint root dir from mach; https://reviewboard.mozilla.org/r/161104/#review166716 ::: tools/lint/mach_commands.py:40 (Diff revision 1) > description='Run linters.', > parser=setup_argument_parser) > def lint(self, *runargs, **lintargs): > """Run linters.""" > from mozlint import cli > + lintargs.setdefault('root', self.topsrcdir) This should already be in lintargs: https://dxr.mozilla.org/mozilla-central/source/python/mozlint/mozlint/roller.py#75 Specifically self.vcs.root should point to topsrcdir. In fact, the value here is being overwritten by the one above. The lintargs are pretty opaque at the moment :(.. they should at least be documented somewhere.
Attachment #8890119 -
Flags: review?(ahalberstadt) → review-
Assignee | ||
Comment 3•6 years ago
|
||
mozreview-review-reply |
Comment on attachment 8890119 [details] Bug 1384273 - Get lint root dir from mach; https://reviewboard.mozilla.org/r/161104/#review166716 > This should already be in lintargs: > https://dxr.mozilla.org/mozilla-central/source/python/mozlint/mozlint/roller.py#75 > > Specifically self.vcs.root should point to topsrcdir. In fact, the value here is being overwritten by the one above. > > The lintargs are pretty opaque at the moment :(.. they should at least be documented somewhere. My specific use case is running from a comm-central repository sitting inside of a mozillla-central repository. In that case, `self.vcs.root` points at the root of comm-central, which is wrong for at least https://dxr.mozilla.org/mozilla-central/source/tools/lint/eslint/setup_helper.py#351 which is what I was trying to fix. Looking at the places that use `lintargs['root']`, I think all of them expect it to be the root of mozilla-central.
Comment 4•6 years ago
|
||
mozreview-review-reply |
Comment on attachment 8890119 [details] Bug 1384273 - Get lint root dir from mach; https://reviewboard.mozilla.org/r/161104/#review166716 > My specific use case is running from a comm-central repository sitting inside of a mozillla-central repository. In that case, `self.vcs.root` points at the root of comm-central, which is wrong for at least https://dxr.mozilla.org/mozilla-central/source/tools/lint/eslint/setup_helper.py#351 which is what I was trying to fix. > > Looking at the places that use `lintargs['root']`, I think all of them expect it to be the root of mozilla-central. Ah, thanks for clarifying! In that case yes, this is fine.
Comment 5•6 years ago
|
||
mozreview-review |
Comment on attachment 8890119 [details] Bug 1384273 - Get lint root dir from mach; https://reviewboard.mozilla.org/r/161104/#review166928
Attachment #8890119 -
Flags: review- → review+
Assignee | ||
Updated•6 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 6•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7d1c35b1ed46320e05e57b8fd55ef6e98a673b41
Updated•6 years ago
|
Assignee: nobody → mozilla
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/autoland/rev/8954e1ad4d82 Get lint root dir from mach; r=ahal
Keywords: checkin-needed
Assignee | ||
Updated•6 years ago
|
Blocks: comm-taskgraph
Assignee | ||
Updated•6 years ago
|
No longer blocks: comm-taskgraph
Comment 8•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8954e1ad4d82
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Updated•6 years ago
|
Product: Testing → Firefox Build System
Updated•5 years ago
|
Version: Version 3 → 3 Branch
Updated•1 year ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•