Closed
Bug 1348997
Opened 8 years ago
Closed 8 years ago
mach eslint should not use the package.json version number to decide if the eslint-plugin-mozilla plugin needs to be updated
Categories
(Developer Infrastructure :: Lint and Formatting, enhancement)
Tracking
(firefox55 fixed)
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: florian, Assigned: standard8)
Details
Attachments
(1 file)
Having to bump this version number in package.json causes bitrot whenever 2 developers are working on eslint rules at the same time. It's already a pain with 2-3 developers hacking rules, but will become unsustainable if we manage to convince more reviewers to write custom rules for review comments they made repeatedly.
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → standard8
Comment hidden (mozreview-request) |
Comment 2•8 years ago
|
||
mozreview-review |
Comment on attachment 8860866 [details]
Bug 1348997 - When ESLint checks for reinstall, check the file diffs rather than a version number.
https://reviewboard.mozilla.org/r/132874/#review135846
::: tools/lint/eslint.lint:156
(Diff revision 1)
> +def check_eslint_files(node_modules_path, name):
> + def check_file_diffs(dcmp):
> + # Diff files only looks at files that are different. Not for files
> + # that are only present on one side. This should be generally OK as
> + # new files will need to be added in the index.js for the package.
> + if dcmp.diff_files and dcmp.diff_files != ['package.json']:
Why don't we care about package.json changes? Surely if the dependencies have changed we should re-install?
Assignee | ||
Comment 3•8 years ago
|
||
mozreview-review-reply |
Comment on attachment 8860866 [details]
Bug 1348997 - When ESLint checks for reinstall, check the file diffs rather than a version number.
https://reviewboard.mozilla.org/r/132874/#review135846
> Why don't we care about package.json changes? Surely if the dependencies have changed we should re-install?
I'd excluded it because npm writes a lot more to the package.json that's installed into node_modules. However, you've made a very good point about the modules, so I'll see if I can adjust it to include something for that.
Comment hidden (mozreview-request) |
Assignee | ||
Comment 5•8 years ago
|
||
mozreview-review-reply |
Comment on attachment 8860866 [details]
Bug 1348997 - When ESLint checks for reinstall, check the file diffs rather than a version number.
https://reviewboard.mozilla.org/r/132874/#review135846
> I'd excluded it because npm writes a lot more to the package.json that's installed into node_modules. However, you've made a very good point about the modules, so I'll see if I can adjust it to include something for that.
I've now extended the script to compare the dependencies and devDependencies. I wasn't quite sure about the devDependencies list, but I thought it could be useful to have anyway.
Comment 6•8 years ago
|
||
mozreview-review |
Comment on attachment 8860866 [details]
Bug 1348997 - When ESLint checks for reinstall, check the file diffs rather than a version number.
https://reviewboard.mozilla.org/r/132874/#review136446
::: tools/lint/eslint.lint.py:204
(Diff revision 2)
> + continue
> +
> + if name == "eslint-plugin-mozilla" or name == "eslint-plugin-spidermonkey-js":
> + # For our in-tree modules, check that package.json has the same dependencies.
> + if (data["dependencies"] != expected_data["dependencies"] or
> + data["devDependencies"] != expected_data["devDependencies"]):
You can't compare objects like this.
Attachment #8860866 -
Flags: review?(dtownsend) → review-
Comment hidden (mozreview-request) |
Assignee | ||
Comment 8•8 years ago
|
||
mozreview-review-reply |
Comment on attachment 8860866 [details]
Bug 1348997 - When ESLint checks for reinstall, check the file diffs rather than a version number.
https://reviewboard.mozilla.org/r/132874/#review136446
> You can't compare objects like this.
Ok, seems like python allows it for really simple dicts, but using cmp is better for most dicts, so I've switched to that.
Comment 9•8 years ago
|
||
mozreview-review |
Comment on attachment 8860866 [details]
Bug 1348997 - When ESLint checks for reinstall, check the file diffs rather than a version number.
https://reviewboard.mozilla.org/r/132874/#review136888
Attachment #8860866 -
Flags: review?(dtownsend) → review+
Comment 10•8 years ago
|
||
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/08cb2f95d844
When ESLint checks for reinstall, check the file diffs rather than a version number. r=mossop
Comment 11•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Reporter | ||
Comment 12•8 years ago
|
||
Thank you very much for fixing this! It makes editing custom eslint rules so much nicer and easier! :-)
Updated•7 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
•