Skip to content
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

[JSConf CN Code&Learn]test: replace string concatenation with template literals #14283

Conversation

jhao
Copy link

@jhao jhao commented Jul 16, 2017

…tructor.js with template literals

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Jul 16, 2017
@joyeecheung joyeecheung added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Jul 16, 2017
@jhao jhao changed the title replace string concatenation in test/parallel/test-child-process-cons… [JSConf CN Code&Learn]test: replace string concatenation with template literals Jul 16, 2017
Trott
Trott previously requested changes Jul 16, 2017
Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

Since we have to keep the split across two lines to stay under 80 chars per line, perhaps it makes sense to split at the sentence break?:

      message: 'The "options" argument must be of type object. ' +
               `Received type typeName(options)`

@Trott
Copy link
Member

Trott commented Jul 16, 2017

I think I have a slight preference for keeping the one concatenation and indenting for readability:

      message: 'The "options" argument must be of type object. ' +
               `Received type typeName(options)`

But I'm good with this the way it is too. What do others think?

@Trott Trott dismissed their stale review July 16, 2017 08:15

now splits at sentence break

Copy link
Member

@Trott Trott left a comment

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.

@vsemozhetbyt
Copy link
Contributor

@vsemozhetbyt
Copy link
Contributor

CIs for this PR fail (second try: https://ci.nodejs.org/job/node-test-pull-request/9171/) due to "merge conflict". Not sure how this can be fixed.

@Trott
Copy link
Member

Trott commented Jul 17, 2017

CIs for this PR fail (second try: https://ci.nodejs.org/job/node-test-pull-request/9171/) due to "merge conflict". Not sure how this can be fixed.

@nodejs/build Any idea what's up? I recall seeing this before but I don't remember the cause and it was a very long time ago....

@gibfahn
Copy link
Member

gibfahn commented Jul 17, 2017

Not sure how this can be fixed.

Ideally by squashing and rebasing on master. @jhao if you're comfortable doing that let us know, otherwise a collaborator can do it.

Process is:

git remote -v # Should look like:
# ❯ git remote -v
# origin	git@github.com:gibfahn/node.git (fetch)
# origin	git@github.com:gibfahn/node.git (push)
# upstream	https://github.com/nodejs/node.git (fetch)
# upstream	https://github.com/nodejs/node.git (push)
git status # Make sure you're on `17.Replace-string-concatenation-with-template-literals`
git branch -u origin/17.Replace-string-concatenation-with-template-literals

git fetch --all
git rebase upstream/master
git push --force-with-lease

@jhao
Copy link
Author

jhao commented Jul 17, 2017

@gibfahn Sure, let me do that, and push that again.

@gibfahn
Copy link
Member

gibfahn commented Jul 17, 2017

@jhao if you could squash down to one commit that'd be good too.

@jhao jhao force-pushed the 17.Replace-string-concatenation-with-template-literals branch from 52048d2 to ada1399 Compare July 17, 2017 08:08
@jhao
Copy link
Author

jhao commented Jul 17, 2017

@gibfahn I have squashed down to one commit about the "merge conflict"

@vsemozhetbyt
Copy link
Contributor

@Trott
Copy link
Member

Trott commented Jul 17, 2017

@gibfahn The confusing part is that it seems like a phantom merge conflict. GitHub interface never reported a merge conflict. Guess I could/should check by rebasing next time and seeing if there's a merge conflict to see if it's Jenkins that is reporting incorrectly or GitHub's interface... (Or maybe I'm just misinterpreting one of the interfaces. ¯\(ツ)/¯)

message: 'The "options" argument must be of type object. Received type ' +
typeName(options)
message: 'The "options" argument must be of type object. ' +
`Received type ${typeName(options)}`
Copy link
Member

Choose a reason for hiding this comment

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

Please align the Received part with the The "options" part :-)

Copy link
Author

Choose a reason for hiding this comment

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

@jasnell I have fixed the code to align the Received part with the The "options" part

@gibfahn
Copy link
Member

gibfahn commented Jul 18, 2017

@Trott I looked at the branch locally and there was a weird merge (looks like the branch got merged into itself).

I wouldn't entirely trust Github's UI, because it assumes you're going to merge the branch in rather than rebasing on top of master, so (I think) it only matters what head of the PR branch looks like. For a rebase (without squashing) every commit has to apply on top of master.

I'd rather just suggest git config --global pull.rebase true in CONTRIBUTING.md, but then you're encouraging people to git push --force-with-lease all the time, which could easily go wrong.

@vsemozhetbyt
Copy link
Contributor

@Trott
Copy link
Member

Trott commented Jul 19, 2017

CI failures appear unrelated. This can land.

jasnell pushed a commit that referenced this pull request Jul 19, 2017
replace string concatenation in test/parallel/test-child-process-constructor.js
with template literals

PR-URL: #14283
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell
Copy link
Member

jasnell commented Jul 19, 2017

Landed in b923b9d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.