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)

3 Branch
enhancement
Not set
normal

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: nobody → standard8
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?
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 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 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 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 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+
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
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Thank you very much for fixing this! It makes editing custom eslint rules so much nicer and easier! :-)
Product: Testing → Firefox Build System
Version: Version 3 → 3 Branch
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: