Closed
Bug 1309963
Opened 9 years ago
Closed 9 years ago
eslint config errors are swallowed and mach eslint does not fail
Categories
(Developer Infrastructure :: Lint and Formatting, defect)
Tracking
(firefox52 fixed)
RESOLVED
FIXED
mozilla52
| Tracking | Status | |
|---|---|---|
| firefox52 | --- | fixed |
People
(Reporter: Fallen, Assigned: ahal)
Details
Attachments
(3 files)
I have some local issue with eslint that causes it to spit out an error message when it is run, complaining about eslint-plugin-mozilla missing.
When running mach eslint though, all I get is: ✖ 0 problems (0 errors, 0 warnings)
Part of the problem is that that the return code is not checked. The first line of output is empty, so the json parsing at https://dxr.mozilla.org/comm-central/source/mozilla/tools/lint/eslint.lint#334 succeeds and no errors are found.
The attached patch fixes that and will print the output correctly.
Unfortunately this is not all of the problem. Even with this issue, the return code of mach eslint is 0. Returning 1 does not trigger any errors, and looking at https://dxr.mozilla.org/comm-central/source/mozilla/python/mozlint/mozlint/roller.py#47 returning a number will indeed just ignore the result.
I unfortunately don't have time at the moment to check how to best make mach fail correctly, but I trust someone will create an awesome solution based on this patch.
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
Comment 3•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8800832 [details]
Bug 1309963 - Make sure return codes are passed from .lint files up to the cli,
https://reviewboard.mozilla.org/r/85652/#review85096
::: python/mozlint/mozlint/roller.py:148
(Diff revision 1)
> + self.return_code = 0
> for worker in workers:
> # parent process blocks on worker.get()
> - for k, v in worker.get().iteritems():
> + results, return_code = worker.get()
> + if results or return_code:
> + self.return_code = 1
Are we OK with collapsing all other return codes down onto return code 1?
Attachment #8800832 -
Flags: review?(james) → review+
Comment 4•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8800831 [details]
Bug 1309963 - Fix hidden eslint error output when the first line is blank,
https://reviewboard.mozilla.org/r/85650/#review85100
Attachment #8800831 -
Flags: review?(james) → review+
| Assignee | ||
Comment 5•9 years ago
|
||
| mozreview-review-reply | ||
Comment on attachment 8800832 [details]
Bug 1309963 - Make sure return codes are passed from .lint files up to the cli,
https://reviewboard.mozilla.org/r/85652/#review85096
> Are we OK with collapsing all other return codes down onto return code 1?
I think so, otherwise we need to solve the problem of what happens if two linters return two different error codes. Seeing as we currently ignore return codes altogether and so far we control what the return codes mean (we don't bubble the eslint/flake8 return codes up), I'm happy to either make them a binary pass/fail or punt on it until we start taking eslint/flake8 into account.
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8e234deee964
Fix hidden eslint error output when the first line is blank, r=jgraham
https://hg.mozilla.org/integration/autoland/rev/01cef2481413
Make sure return codes are passed from .lint files up to the cli, r=jgraham
Comment 7•9 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/8e234deee964
https://hg.mozilla.org/mozilla-central/rev/01cef2481413
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Updated•8 years ago
|
Product: Testing → Firefox Build System
Updated•7 years ago
|
Version: Version 3 → 3 Branch
Updated•3 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•