Skip to content

Conversation

@furnox
Copy link
Contributor

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test

Description of change

Added common.mustCall in child process on 'close' callback
Changed several 'var' statements to 'const' or 'let' where appropriate
Also linting

Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting
@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Dec 1, 2016
@mscdexmscdex added the child_process Issues and PRs related to the child_process subsystem. label Dec 1, 2016
@imyllerimyller added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Dec 1, 2016
constchild=child_process.exec(cmd);
letoutput='';
constoutputExpect={'code': 'EPIPE',
'errno': 'EPIPE',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these lines should probably be indented as well.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@cjihrig - thanks for looking at this.
I'm perfectly happy to align to any coding style, however, what is the style to be? make lint didn't make a peep over the alignment of these lines. My own style would be to indent these lines like so:

const outputExpect ={'code': 'EPIPE', 'errno': 'EPIPE', 'syscall': 'write' }; 

but I don't know if that's the indentation you'd like to see.

Copy link
Member

Choose a reason for hiding this comment

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

@furnox What you have as your preference there is fine. (That's my preference too but it's not universal on the project. Basically, as long as the property names are lined up, that's the main thing.)

When we get over a couple of issues that are preventing us from updating ESLint, we will have more strict linting for indentation. Thanks for bearing with us until then.

Also, while you're in here editing: it seems like the quotation marks around the property names are unnecessary. If I'm not mistaken, it could be written as:

constoutputExpect={code: 'EPIPE',errno: 'EPIPE',syscall: 'write'};

If there's a good reason for the quotation marks, then I guess keep them, but if not, perhaps take this opportunity to remove them.

assert.deepStrictEqual(output,outputExpect);
console.log('ok');
});
}),1);
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't needed. 1 is the default for common.mustCall().

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Good point. I'll fix that.

Defaulting to mustCall number of 1. Indenting obj properties
Copy link
Member

@mhdawsonmhdawson left a comment

Choose a reason for hiding this comment

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

LGTM provide CI is green

@silverwind
Copy link
Contributor

Thanks! Landed in 4a08ac6.

silverwind pushed a commit that referenced this pull request Dec 16, 2016
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
italoacasas pushed a commit that referenced this pull request Dec 17, 2016
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
@italoacasasitaloacasas mentioned this pull request Dec 17, 2016
cjihrig pushed a commit that referenced this pull request Dec 20, 2016
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
targos pushed a commit that referenced this pull request Dec 26, 2016
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
@MylesBorinsMylesBorins mentioned this pull request Dec 27, 2016
targos pushed a commit that referenced this pull request Dec 28, 2016
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 23, 2017
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
@MylesBorinsMylesBorins mentioned this pull request Jan 24, 2017
MylesBorins pushed a commit that referenced this pull request Feb 1, 2017
Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: #10006 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

child_processIssues and PRs related to the child_process 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.

9 participants

@furnox@silverwind@Trott@targos@cjihrig@mhdawson@mscdex@imyller@nodejs-github-bot