GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — test: convert var->const/let in tests by gibfahn · Pull Request #10685 · nodejs/node Conversation
|
|
cc/ @nodejs/testing cc/ @silverwind @Trott @not-an-aardvark Is there an easy way to make rules only apply to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add the rule to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Thanks, done |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Rubber stamp LGTM if the CI passes.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
CI: https://ci.nodejs.org/job/node-test-commit/7103/ EDIT: CI passed |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It's probably worth checking the second and third commits: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Rubber-stamp LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Should these be:
no-var: 2
prefer-const: 2
? I'm not sure what the 2 represents here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
2 means error
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Changed error to 2 for consistency.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
CI 2: https://ci.nodejs.org/job/node-test-commit/7112/ EDIT: Still green |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think you can const this one.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
➜ node git:(var2const) tools/test.py test/parallel/test-http-get-pipeline-problem.js === release test-http-get-pipeline-problem === Path: parallel/test-http-get-pipeline-problem image.length = 45658 /Users/gib/wrk/com/node/test/parallel/test-http-get-pipeline-problem.js:38 for (const i = 0; i < total; i++) { ^ TypeError: Assignment to constant variable.
If this is what you meant, I don't think so. I can do for (let i = 0; though.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Weird, I could swear const loop variables once worked, but I see it's failing now. Your let suggestion sounds good.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
unneccesary wrapping?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The semicolon puts it over 80 chars 😭
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
unneccesary wrapping?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
81 chars again
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Move the string to a variable so it doesn't look so hideous? :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
unneccesary wrapping?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
➜ node git:(var2const) ✗ make lint
./node tools/eslint/bin/eslint.js --cache --rulesdir=tools/eslint-rules \
benchmark lib test tools
/Users/gib/wrk/com/node/test/parallel/test-net-local-address-port.js
16:1 error Line 16 exceeds the maximum line length of 80 max-len
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
unneccesary wrapping?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
as above
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
unneccesary wrapping?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
as above
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same here, can probably use const.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Changed to let as above (const didn't work)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
const again.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
const here too.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
const doesn't work (the pending++ would be modifying it)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actually, as is the test failed (it's not run in CI), to fix I had to move the let to the previous line.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Maybe alphabetically sort the rules?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Will do
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@silverwind Updated, PTAL |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Actually, I just realised that the eslint rule isn't showing up all the vars for some reason, I'll investigate later. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Manually fix issues that eslint --fix couldn't do automatically. PR-URL: #10685 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
PR-URL: #10685 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
Manually fix issues that eslint --fix couldn't do automatically. PR-URL: nodejs#10685 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
PR-URL: nodejs#10685 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
Manually fix issues that eslint --fix couldn't do automatically. PR-URL: nodejs#10685 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
PR-URL: nodejs#10685 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
|
This will need backport PRs in order to land on v6 or v4 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This is likely preventing a lot of pull requests from back-porting cleanly so I think it should be back-ported with some urgency. Likewise for #10698. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
v4.x backport: #10685 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@gibfahn did can you do a v6.x backport too? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@MylesBorins I'll do it once I get the v4.x backport working. There's more pig-wrestling than I'd expected. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Backport-PR-URL: #11775 PR-URL: #10685 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
Manually fix issues that eslint --fix couldn't do automatically. Backport-PR-URL: #11775 PR-URL: #10685 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
Backport-PR-URL: #11775 PR-URL: #10685 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
Manually fix issues that eslint --fix couldn't do automatically. Backport-PR-URL: #11775 PR-URL: #10685 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
Backport-PR-URL: nodejs/node#11775 PR-URL: nodejs/node#10685 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
Manually fix issues that eslint --fix couldn't do automatically. Backport-PR-URL: nodejs/node#11775 PR-URL: nodejs/node#10685 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.