-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: change equal to strictEqual in path tests #8628
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
// POSIX filenames may include control characters | ||
// c.f. http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html | ||
const controlCharFilename = 'Icon' + String.fromCharCode(13); | ||
assert.equal(path.posix.basename('/a/b/' + controlCharFilename), | ||
assert.strictEqual(path.posix.basename('/a/b/' + controlCharFilename), | ||
controlCharFilename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you try and align the arguments here and in cases like this? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@addaleax ofc!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine other than some alignment issues.
@lrlna can you try running make -j4 lint
? I think it should catch these... maybe not though.
I don't think this should cause too many conflicts as I'm not aware of any major changes to path
recently.
'\\\\unc\\share\\'); | ||
assert.strictEqual(path.win32.dirname('\\\\unc\\share\\foo\\'), | ||
'\\\\unc\\share\\'); | ||
assert.strictEqual(path.win32.dirname('\\\\unc\\share\\foo\\bar'), | ||
'\\\\unc\\share\\foo'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
misaligned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
'\\\\unc\\share\\foo'); | ||
assert.equal(path.win32.dirname('\\\\unc\\share\\foo\\bar\\baz'), | ||
assert.strictEqual(path.win32.dirname('\\\\unc\\share\\foo\\bar\\baz'), | ||
'\\\\unc\\share\\foo\\bar'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and done 🎉
@Fishrock123 The linter does not catch this, and I think we’ve talked about maybe enabling a rule like that, so… @Trott? |
I implemented the |
Quick implementation suggests enabling alignment for this situation will find around 66 alignment problems in the existing code base. That sounds like the upper edge of acceptable churn for something like this to me so I'll put together a PR. @Irina, if you could align the instances this PR, that would be great. Sorry we didn't have a lint rule in place to catch it before it got submitted as a PR. |
@Trott I think it’s worth it because usually someone will point out those misalignments… maybe wait a couple of days, though. 😄 |
(There will still be lots of alignment issues that the rule doesn't catch but I'm OK with slowly ratcheting it up over time rather than all at once.) |
@addaleax @Fishrock123 Here's a PR with the alignment linting: #8642 |
howdy, apologies for disappearing! Miss-alignments have been fixed and pushed 💯 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits in recent PR comments suggest that we can have slightly more strict linting for argument alignment in multiline function calls. This enables the existing linting requirements to apply when one or more of the arguments themselves are function calls. Previously, that situation had been excluded from linting. Refs: nodejs#8628 (comment) PR-URL: nodejs#8642 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Awesome job!
PR-URL: #8628 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Landed in daa0f90! thank you! |
omg YAY! 🎉 |
A few nits in recent PR comments suggest that we can have slightly more strict linting for argument alignment in multiline function calls. This enables the existing linting requirements to apply when one or more of the arguments themselves are function calls. Previously, that situation had been excluded from linting. Refs: #8628 (comment) PR-URL: #8642 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
PR-URL: #8628 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
tests
Description of change
Use strict equality in
test-path
set of unit tests.