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

util: use blue on non-windows systems for number/bigint #18925

Closed
wants to merge 1 commit into from

Conversation

devsnek
Copy link
Member

@devsnek devsnek commented Feb 22, 2018

the only reason these stopped being blue is windows, and honestly util.inspect output looks so much more balanced with blue.

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

util

@nodejs-github-bot nodejs-github-bot added the util Issues and PRs related to the built-in util module. label Feb 22, 2018
@devsnek
Copy link
Member Author

devsnek commented Feb 22, 2018

assert.strictEqual(
util.inspect(list),
'BufferList { length: \u001b[33m0\u001b[39m }');
Copy link
Member Author

Choose a reason for hiding this comment

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

does anyone know why this test needs to be done with colors?

Copy link
Member

Choose a reason for hiding this comment

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

There is a custom inspect function on the BufferList. It is special in the way that it should set the color on that property in case colors = true.

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 meant why is it testing that colors work, that's effectively testing util, not bufferlist

Copy link
Member

Choose a reason for hiding this comment

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

No, it is testing the return value of the custom inspect function of BufferList.

@devsnek
Copy link
Member Author

devsnek commented Feb 22, 2018

ci failure unrelated (parallel/test-http-connect)

Copy link
Member

@lpinca lpinca left a comment

Choose a reason for hiding this comment

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

SGTM

@devsnek
Copy link
Member Author

devsnek commented Feb 25, 2018

this still needs another approval

@devsnek devsnek added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 25, 2018
@devsnek
Copy link
Member Author

devsnek commented Feb 25, 2018

landed in 1708af3

@devsnek devsnek closed this Feb 25, 2018
@devsnek devsnek removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 25, 2018
@devsnek devsnek deleted the fix/colours-for-proper-oses branch February 25, 2018 23:04
devsnek added a commit that referenced this pull request Feb 25, 2018
PR-URL: #18925
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@MylesBorins
Copy link
Contributor

Should this be backported to v9.x-staging? If yes please follow the guide and raise a backport PR, if not let me know or add the dont-land-on label.

@addaleax
Copy link
Member

addaleax commented Mar 6, 2018

@devsnek Fwiw, this is how this looks for me…

screenshot from 2018-03-06 23-01-50

There was much better contrast with the previous yellow :/ Maybe we should reconsider?

@devsnek
Copy link
Member Author

devsnek commented Mar 6, 2018

@addaleax i think that just comes down to your terminal styling, for instance in the default macos terminal (which i don't use <.<) its much clearer as blue. fwiw gnu highlighter uses blue for numbers too so there can be an argument made for "consistency," although i don't place much stock by that

@addaleax
Copy link
Member

addaleax commented Mar 6, 2018

@devsnek Yeah, and it’s no problem to change the colour for me. I just wanted to mention that this can noticeably decrease visibility.

devsnek added a commit to devsnek/node that referenced this pull request Mar 6, 2018
PR-URL: nodejs#18925
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
MylesBorins pushed a commit that referenced this pull request Mar 7, 2018
Backport-PR-URL: #19180
PR-URL: #18925
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@MylesBorins MylesBorins mentioned this pull request Mar 7, 2018
addaleax pushed a commit that referenced this pull request Mar 17, 2018
This reverts commit 1708af3.

Numbers are much more difficult to read in blue and it would be good
to have a consistent output throughout all OS.

PR-URL: #19256
Refs: #18925
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
PR-URL: nodejs#18925
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants