-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console][PhpUnitBridge][VarDumper] Add support for FORCE_COLOR
environment variable
#57777
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
Conversation
serious-angel
commented
Jul 19, 2024
•
edited
Loading
edited
Q | A |
---|---|
Branch? | 7.2 |
Bug fix? | no |
New feature? | yes |
Deprecations? | no |
Issues | |
License | MIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about CHANGELOG
file and how breaking it is.
Please suggest any details if possible.
Related: chalk/supports-color#105
Related also: https://force-color.org/ |
BTW, https://no-color.org/ tells that the NO_COLOR env var should not be the empty string, and we don't follow this spec currently. I think we should. |
FORCE_COLOR
environment variable
…alue handling (alexandre-daubois) This PR was merged into the 5.4 branch. Discussion ---------- [Console][PhpUnitBridge][VarDumper] Fix `NO_COLOR` empty value handling | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | #57777 (comment) | License | MIT `NO_COLOR` must be non-empty in order to be considered enabled (https://no-color.org/): > when present and not an empty string (regardless of its value) Commits ------- 6a96ff9 [Console][PhpUnitBridge][VarDumper] Fix `NO_COLOR` empty value handling
…alue handling (alexandre-daubois) This PR was merged into the 5.4 branch. Discussion ---------- [Console][PhpUnitBridge][VarDumper] Fix `NO_COLOR` empty value handling | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | symfony/symfony#57777 (comment) | License | MIT `NO_COLOR` must be non-empty in order to be considered enabled (https://no-color.org/): > when present and not an empty string (regardless of its value) Commits ------- 6a96ff9116 [Console][PhpUnitBridge][VarDumper] Fix `NO_COLOR` empty value handling
Hi @artshade, you may have a look at this fix to be sure to update everywhere it is relevant in Symfony: #57815 |
This is awesome! Thank you, @alexandre-daubois ! Have you considered the related forced color option? |
You seemed to be well on your way to adding this feature, so I didn't want to impose a PR if you wanted to finish it :) |
45133e8
to
9cd9c63
Compare
Changed the priority of if (no_color != NULL && no_color[0] != '\0')
color = false;
// ...
if (force_color != NULL && force_color[0] != '\0')
color = true; Regarding the PR, I am frankly not sure if the current state of the PR is correct considering all the branches and rules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Please add a test.
…ironment variable
9cd9c63
to
5b54524
Compare
FORCE_COLOR
environment variableFORCE_COLOR
environment variable
Thank you @artshade. |
I am sorry for not implementing the test in-time... Let it be colors! 🌈 ✨ |