-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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: enforce shouldColorize in styleText array arg #56722
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #56722 +/- ##
========================================
Coverage 89.21% 89.21%
========================================
Files 662 662
Lines 191945 192113 +168
Branches 36948 36972 +24
========================================
+ Hits 171238 171390 +152
- Misses 13549 13550 +1
- Partials 7158 7173 +15
|
4e13dd5
to
4599cad
Compare
4599cad
to
d4b5727
Compare
|
||
return `${left}${text}${right}`; | ||
// If the stream is falsy or should not be colorized, set skipColorize to true | ||
skipColorize = !lazyUtilColors().shouldColorize(stream); |
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.
How about returning text
here if lazyUtilColors().shouldColorize(stream)
is false?
(If this change is applied, we also need to modify line 122, 147, and 152)
skipColorize = !lazyUtilColors().shouldColorize(stream); | |
if (!lazyUtilColors().shouldColorize(stream)) { | |
return text; | |
} |
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.
This would not validate the styles which is what I wanted to avoid
Fixes: #56717