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

lib, test: minor console changes #20960

Closed
wants to merge 3 commits into from

Conversation

BridgeAR
Copy link
Member

I was working on console a bit and I decided to split my work into smaller chunks. This is just a minor refactoring of the cli table and it improves the error output in case of an error for console table.

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

The cli table used multi line template strings which are normally
not used in our code base and it also upper cased a regular function
name. This is changed by this patch.
The former error output was not readable in case of an error. This
improves it by splitting the lines and therefore creating a nice and
readable diff.
@BridgeAR
Copy link
Member Author

@trivikr trivikr added test Issues and PRs related to the tests. lib / src Issues and PRs related to general changes in the lib or src directory. labels May 26, 2018
@BridgeAR
Copy link
Member Author

PTAL

@BridgeAR BridgeAR requested a review from devsnek May 28, 2018 13:25
@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 29, 2018
@trivikr
Copy link
Member

trivikr commented Jun 6, 2018

cc @devsnek

@@ -2,7 +2,7 @@

const { Buffer } = require('buffer');
const { removeColors } = require('internal/util');
const HasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);
const hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);
Copy link
Member

Choose a reason for hiding this comment

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

I know @bmeck has also been doing it this way, (at least guessing from the reasons that I use it) that it matches the name the spec uses?

Copy link
Member

Choose a reason for hiding this comment

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

@BridgeAR are you attached to this particular change? It's the only thing stopping me from approving & landing to be honest and I've looked at this PR several times. I believe we should have a convention and follow it — at the moment uppercase is the way we do this in most files. I'm not opposed to switching but I don't think it should be done incrementally.

Copy link
Member Author

Choose a reason for hiding this comment

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

I switched it back even though this is really weird for me as it is not a class. IMO we should only have upper case characters for classes.

@targos
Copy link
Member

targos commented Jun 8, 2018

@targos
Copy link
Member

targos commented Jun 24, 2018

@targos
Copy link
Member

targos commented Jul 14, 2018

And again: https://ci.nodejs.org/job/node-test-pull-request/15873/
This time I'll keep the tab open to not forget about it.

@targos
Copy link
Member

targos commented Jul 14, 2018

@BridgeAR Can you give an example of value for which the output is different with this PR? I'd like to test it.

@BridgeAR
Copy link
Member Author

@targos the test output is now readable in case of a failure in test/parallel/test-console-table.js. That is just due to the different input value in the test itself.

@targos
Copy link
Member

targos commented Jul 14, 2018

@BridgeAR Is the output of console.table(value) the same as before, whatever value may be?

Edit: Confirmed it by looking more closely at the code.
I thought the change from !rows[j] to rows[j] === undefined would change behavior.

targos pushed a commit to targos/node that referenced this pull request Jul 14, 2018
The cli table used multi line template strings which are normally
not used in our code base and it also upper cased a regular function
name. This is changed by this patch.

PR-URL: nodejs#20960
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
targos pushed a commit to targos/node that referenced this pull request Jul 14, 2018
The former error output was not readable in case of an error. This
improves it by splitting the lines and therefore creating a nice and
readable diff.

PR-URL: nodejs#20960
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
@targos
Copy link
Member

targos commented Jul 14, 2018

Landed in 8b0c6d8 and cee8677

@targos targos closed this Jul 14, 2018
@targos targos removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 14, 2018
targos pushed a commit that referenced this pull request Jul 14, 2018
The cli table used multi line template strings which are normally
not used in our code base and it also upper cased a regular function
name. This is changed by this patch.

PR-URL: #20960
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
targos pushed a commit that referenced this pull request Jul 14, 2018
The former error output was not readable in case of an error. This
improves it by splitting the lines and therefore creating a nice and
readable diff.

PR-URL: #20960
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
@targos targos mentioned this pull request Jul 17, 2018
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. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants