Skip to content

test: replace string concatenation with path.join in test-graph.tls-write.js - #14272

Closed
jkzing wants to merge 1 commit into
nodejs:masterfrom
jkzing:replace-concat
Closed

test: replace string concatenation with path.join in test-graph.tls-write.js#14272
jkzing wants to merge 1 commit into
nodejs:masterfrom
jkzing:replace-concat

Conversation

@jkzing

@jkzingjkzing commented Jul 16, 2017

Copy link
Copy Markdown
Contributor
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test

This is a PR from JSConf CN Code & Learn workshop. 👻

@nodejs-github-botnodejs-github-bot added async_hooks Issues and PRs related to the async hooks subsystem. test Issues and PRs related to the tests. labels Jul 16, 2017
@jkzingjkzing changed the title [Code & Learn] test: use template string literals in test-graph.tls-write.jstest: use template string literals in test-graph.tls-write.jsJul 16, 2017
@joyeecheungjoyeecheung added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Jul 16, 2017

@TrottTrott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if CI is green

@TimothyGuTimothyGu added code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. and removed code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. labels Jul 16, 2017
@vsemozhetbyt

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to throw a wrench, and this should be path.join

@tniessentniessenJul 16, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have had the same discussion in other PRs before, and we would have to change this in quite many files. It does not make it worse than it is :)

But I agree that we should use path.join, so if you want to change this... @jkzing

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, no problem on that.
So if I touch string concatenation that used as path next time, path.join is preferred rather than template string syntax, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO is these cases path.join is much better:

  1. it's more correct — Windows uses \ while other OSs use /, and path.join handles that
  2. it's more expressive — you explicitly say "this is a path I'm working with here"
  3. more readable — a little bit easier to see the parts that are being joined

@refackrefack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯
Thanks you!

@refack

Copy link
Copy Markdown
Contributor

@jkzing thank you very much for you contribution. "Change requests" are a normal part of the process. Personally I'm very happy you did follow up and made the code even better 🥇 Hope to see you contributing more.

@tniessentniessen self-assigned this Jul 16, 2017
@jkzing

jkzing commented Jul 16, 2017

Copy link
Copy Markdown
ContributorAuthor

@refack With pleasure. Code review makes our code better.😄

@Trott

Copy link
Copy Markdown
Member

Looks like something went wrong with a number of CI builds. We'll have to re-run this on CI, but unfortunately not right now, because it's got quite a large backlog of jobs at the moment.

@Trott

Copy link
Copy Markdown
Member

@Trott

Copy link
Copy Markdown
Member

Two test failures in CI are unrelated. CI can be considered green!

@trevnorristrevnorris left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git title is too long. Please limit it to 50 characters. You can remove the file name. That's easy enough to see by looking at the commit stat.

@jkzingjkzing changed the title test: use template string literals in test-graph.tls-write.jstest: replace string concatenation with path.join in test-graph.tls-write.jsJul 18, 2017
@jkzing

Copy link
Copy Markdown
ContributorAuthor

@trevnorris done.

@trevnorristrevnorris left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks much

refack pushed a commit to refack/node that referenced this pull request Jul 19, 2017
PR-URL: nodejs#14272
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
@refack

Copy link
Copy Markdown
Contributor

Landed in 97008a7

@refackrefack closed this Jul 19, 2017
@jkzing
jkzing deleted the replace-concat branch July 20, 2017 03:01
addaleax pushed a commit that referenced this pull request Jul 22, 2017
PR-URL: #14272
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Fishrock123 pushed a commit that referenced this pull request Jul 24, 2017
PR-URL: #14272
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
@addaleaxaddaleax mentioned this pull request Jul 24, 2017
@addaleaxaddaleax mentioned this pull request Aug 2, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

async_hooksIssues and PRs related to the async hooks subsystem.code-and-learnIssues related to the Code-and-Learn events and PRs submitted during the events.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

14 participants

@jkzing@vsemozhetbyt@refack@Trott@trevnorris@jasnell@cjihrig@tniessen@gireeshpunathil@gibfahn@AndreasMadsen@TimothyGu@joyeecheung@nodejs-github-bot