Add an option to mozlint to output paths relative to repository
Categories
(Developer Infrastructure :: Lint and Formatting, enhancement)
Tracking
(firefox70 fixed)
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: bastien, Assigned: bastien)
References
Details
Attachments
(1 file)
I suggest adding a new CLI option to mozlint, in order to output issues paths relative to the repository.
It's needed for the code-review bot, to avoid cleaning the analyzers outputs, and maintaining a list of checkout folders...
The option --relative
will be inactive by default to preserve the current behaviour.
Assignee | ||
Comment 1•5 years ago
|
||
Comment 2•5 years ago
|
||
What if we do this by default? Is there any other service which is relying on the absolute path?
Comment 3•5 years ago
•
|
||
Yeah, I don't think we need a flag for this, let's just do it by default. It should be fine as long as we're consistent. We use abspath because I needed to be sure that every linter returned the paths in the same format (so mozlint could collapse them accurately). But making sure every path is relative should accomplish the same thing.
Note another way of solving this would be to store lint.root
in the Issue
container. Then each record emitted by the json
formatter would have both the repo root and the abspath, so the reviewbot could calculate the relpath. Actually, we should probably put root
in there regardless (in case something does need an abspath).
Comment 4•5 years ago
|
||
Or rather than storing root
in every Issue
, we can put it on the ResultSummary
class (which is what gets passed into the formatters):
https://searchfox.org/mozilla-central/source/python/mozlint/mozlint/roller.py#109
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
Thanks for the feedback Andrew, i updated the new version by storing root
in ResultSummary
.
I initially implemented the relative path output without an option, but was worried about breaking other user's setups...
Pushed by babadie@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/639f502ded6b Output issues relative paths in mozlint, r=ahal
Comment 7•5 years ago
|
||
ml tier 2 failures on autoland.
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=258954747&repo=autoland&lineNumber=869
Comment 8•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Updated•2 years ago
|
Description
•