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

tools: add 'spaced-comment' into eslint rules #19596

Closed
wants to merge 5 commits into from

Conversation

starkwang
Copy link
Contributor

@starkwang starkwang commented Mar 25, 2018

This rule is not very important but still makes sense to some first-time PRs.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Mar 25, 2018
@starkwang starkwang added the tools Issues and PRs related to the tools directory. label Mar 25, 2018
@@ -260,7 +260,7 @@ assert.throws(function() {

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this line correct now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this some built-in exception for jsdoc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. '*' is the default marker (see here), so /** can pass the check.

@vsemozhetbyt
Copy link
Contributor

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

I like this. Just a couple suggestions to remove things that seem to be obsolete. When being on it: it would also be very nice if you would use a capital letter for the first character of a comment :-) that way these changes have to be done only once instead of twice.

@@ -227,10 +227,10 @@ function runClient(prefix, port, options, cb) {
}
});

//client.stdout.pipe(process.stdout);
// client.stdout.pipe(process.stdout);
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: remove this. There is no comment about why this is kept in here.


client.on('exit', function(code) {
//assert.strictEqual(
// assert.strictEqual(
// 0, code,
// `${prefix}${options.name}: s_client exited with error code ${code}`);
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: remove this. There is no comment about why this is kept in here.

//child.stdout.pipe(process.stdout);
//child.stderr.pipe(process.stderr);
// child.stdout.pipe(process.stdout);
// child.stderr.pipe(process.stderr);
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: remove this. There is no comment why this is kept in here.

@@ -32,7 +32,7 @@ function newBuffer(size, value) {
while (size--) {
buffer[size] = value;
}
//buffer[buffer.length-2]= 0x0d;
// buffer[buffer.length-2]= 0x0d;
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: remove this. There is no comment why this is kept in here.

@@ -39,7 +39,7 @@ function tailCB(data) {
PASS = !data.toString().includes('.');

if (PASS) {
//console.error('i');
// console.error('i');
} else {
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: rewrite this to if (!PASS) { ...

@@ -55,7 +55,7 @@ function testHttps() {
method: 'GET',
path: `/${counter++}`,
host: 'localhost',
//agent: false,
// agent: false,
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: remove this and the other cases as well. There is no comment why this is kept in here.

@@ -78,7 +78,7 @@ server.on('listening', function() {
});

c.on('data', function(chunk) {
//console.log(chunk);
// console.log(chunk);
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: remove this. If the test fails, this has to be debugged properly anyway and maybe needs a code change but the comment does not help in this case.

@@ -103,7 +103,7 @@ server.on('listening', function() {
headers: {}
}, function(res) {
res.on('end', function() {
//console.log(res.trailers);
// console.log(res.trailers);
assert.ok('x-foo' in res.trailers, 'Client doesn\'t see trailers.');
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: remove the comment and change the error message to include res.trailers.

@@ -32,7 +32,7 @@ const options = {
host: '127.0.0.1',
};

//http.globalAgent.maxSockets = 15;
// http.globalAgent.maxSockets = 15;
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: remove this. There is no comment why this is kept in here.

@@ -49,7 +49,7 @@ function nextRequest() {
// throws error:
nextRequest();
// works just fine:
//process.nextTick(nextRequest);
// process.nextTick(nextRequest);
Copy link
Member

Choose a reason for hiding this comment

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

Please add TODO: investigate why this does not work fine even though it should..

//console.log(res.trailers);
assert.ok('x-foo' in res.trailers, 'Client doesn\'t see trailers.');
assert.ok('x-foo' in res.trailers,
'Client doesn\'t see trailers in res.trailers');
Copy link
Contributor Author

@starkwang starkwang Mar 25, 2018

Choose a reason for hiding this comment

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

res.trailers is an Object. Should we use the Object.keys to show all the keys? @BridgeAR

Copy link
Member

Choose a reason for hiding this comment

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

Maybe just use util.inspect? Object.keys works just as fine as well though, as it is only about the keys in this case.

@starkwang
Copy link
Contributor Author

Copy link
Contributor

@thefourtheye thefourtheye left a comment

Choose a reason for hiding this comment

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

I would prefer landing the commented code removal as a separate commit.

@Trott
Copy link
Member

Trott commented Mar 26, 2018

I suspect some on @nodejs/release might greatly prefer that the backports for this be in place when this lands so they can land immediately too?

On the other hand, maybe not since it's only affecting comments?

I'll add backport-requested labels but feel free to remove them if that's not the right thing to do.

@Trott
Copy link
Member

Trott commented Mar 26, 2018

(Left out a backport request for 4.x since it's EOL in about a month.)

@starkwang
Copy link
Contributor Author

@starkwang
Copy link
Contributor Author

Landed in 2540581

@starkwang starkwang closed this Apr 1, 2018
starkwang added a commit that referenced this pull request Apr 1, 2018
PR-URL: #19596
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request May 1, 2018
PR-URL: nodejs#19596
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib / src Issues and PRs related to general changes in the lib or src directory. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants