Closed
Bug 1358310
Opened 7 years ago
Closed 7 years ago
eslint-plugin-mozilla gets stuck in a loop looking for .eslintignore when used outside mozilla-central
Categories
(Developer Infrastructure :: Lint and Formatting, defect)
Developer Infrastructure
Lint and Formatting
Tracking
(firefox55 fixed)
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: mythmon, Assigned: mythmon)
Details
Attachments
(1 file)
When searching for the root of the current repository [0], eslint-plugin-mozilla has a loop like this while (dirName && !fs.existsSync(path.join(dirName, ".eslintignore"))) { dirName = path.dirname(dirName); } This assumes that when the loop gets to the "top" of the file system, dirname will return a falsey value and the loop will terminate. Instead |path.dirname("/")| returns "/" and |path.dirname("C:/")| returns "C:/". This causes an infinite loop. With this fixed, external users of eslint-plugin-mozilla will get an error, because the root directory can't be found, which is at least better than a hang. [0]: https://dxr.mozilla.org/mozilla-central/rev/20dff607fb88ee69135a280bbb7f32df75a86237/tools/lint/eslint/eslint-plugin-mozilla/lib/helpers.js#528-530
Comment hidden (mozreview-request) |
Comment 2•7 years ago
|
||
mozreview-review |
Comment on attachment 8861610 [details] Bug 1358310 - eslint-plugin-mozilla: Fix infinite loop when finding repo root. https://reviewboard.mozilla.org/r/133578/#review136490
Attachment #8861610 -
Flags: review?(dtownsend) → review+
Comment 3•7 years ago
|
||
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again. hg error in cmd: hg rebase -s 0664f683e605 -d 73b97e528623: rebasing 391730:0664f683e605 "Bug 1358310 - eslint-plugin-mozilla: Fix infinite loop when finding repo root. r=mossop" (tip) merging tools/lint/eslint/eslint-plugin-mozilla/lib/helpers.js merging tools/lint/eslint/eslint-plugin-mozilla/package.json warning: conflicts while merging tools/lint/eslint/eslint-plugin-mozilla/package.json! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue)
Comment hidden (mozreview-request) |
Pushed by mcooper@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c1db498519cd eslint-plugin-mozilla: Fix infinite loop when finding repo root. r=mossop
Comment 6•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c1db498519cd
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Updated•6 years ago
|
Product: Testing → Firefox Build System
Updated•2 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
•