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

refactor: just disable color output rather than tracking terminal width #1087

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Jul 2, 2024

This lets us drop some conditionals - weirdly it doesn't seem to work if we move the conditional text.DisableColors call into reporter.New even though that does work for the vertical reporter...

@G-Rath G-Rath requested review from another-rex, cuixq and hogo6002 July 2, 2024 04:22
@codecov-commenter
Copy link

codecov-commenter commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.40%. Comparing base (556817b) to head (86bff5b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1087      +/-   ##
==========================================
- Coverage   65.40%   65.40%   -0.01%     
==========================================
  Files         150      150              
  Lines       12518    12521       +3     
==========================================
+ Hits         8188     8189       +1     
- Misses       3872     3873       +1     
- Partials      458      459       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

Thanks!

@another-rex
Copy link
Collaborator

This lets us drop some conditionals - weirdly it doesn't seem to work if we move the conditional text.DisableColors call into reporter.New even though that does work for the vertical reporter...

Maybe it's because there multiple reporter.New() calls every run, and the disable color function is a single global variable.

@G-Rath
Copy link
Collaborator Author

G-Rath commented Jul 2, 2024

yeahhhhh but then why would it work for the vertical output...? something odd is def going on but I think it's probably best we deal with that once we've landed the vertical report since we plan to shuffle things around a bit re table anyway right

@G-Rath
Copy link
Collaborator Author

G-Rath commented Jul 2, 2024

Weirdly too it seems like it's a very stable global? I've run the test suite a ton and it never seems to give different results like I'd expect if this is an unstable use of a global...?

(fwiw I vote we land this for now - we can easily revert if it turns out to be flakey)

@hogo6002 hogo6002 merged commit 8f2c059 into google:main Jul 2, 2024
13 checks passed
@G-Rath G-Rath deleted the refactor/disable-color branch July 2, 2024 20:23
another-rex pushed a commit that referenced this pull request Jul 9, 2024
I mistakenly changed the order that styles are applied in #1087 for the
table formatter so our custom styles were immediately overridden when
the rounded style was applied
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants