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

Disable color when not in terminal #1065

Merged
merged 4 commits into from
Feb 10, 2021
Merged

Disable color when not in terminal #1065

merged 4 commits into from
Feb 10, 2021

Conversation

dfreilich
Copy link
Member

Summary

Output

Before

Screen Shot 2021-02-09 at 11 54 28 AM

After

Screen Shot 2021-02-09 at 11 55 22 AM

Documentation

  • Should this change be documented?
    • No

Related

Resolves #486

@dfreilich dfreilich requested a review from a team as a code owner February 9, 2021 09:56
@github-actions github-actions bot added the type/enhancement Issue that requests a new feature or improvement. label Feb 9, 2021
@github-actions github-actions bot added this to the 0.18.0 milestone Feb 9, 2021
@codecov
Copy link

codecov bot commented Feb 9, 2021

Codecov Report

Merging #1065 (34b7426) into main (40e2f98) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1065      +/-   ##
==========================================
- Coverage   80.37%   80.35%   -0.01%     
==========================================
  Files         130      130              
  Lines        7969     7964       -5     
==========================================
- Hits         6404     6399       -5     
  Misses       1147     1147              
  Partials      418      418              
Flag Coverage Δ
os_linux 79.69% <100.00%> (+0.01%) ⬆️
os_macos 77.11% <87.50%> (+0.08%) ⬆️
os_windows 80.27% <100.00%> (-0.01%) ⬇️
unit 79.69% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

internal/logging/logging.go Outdated Show resolved Hide resolved
Copy link
Member

@jromero jromero left a comment

Choose a reason for hiding this comment

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

Minor changes requested

* Move IsTerminal to internal logging package, to keep it general but not expose it as part of public API

Signed-off-by: David Freilich <dfreilich@vmware.com>
* Change log_writer tests to run sequentially - In a number of tests, we adjust the color settings of the terminal, which adjusts it globally. There are edge cases, therefore, where our adjusting color in one test could adjust it for another test and cause odd failures

Signed-off-by: David Freilich <dfreilich@vmware.com>
Signed-off-by: David Freilich <dfreilich@vmware.com>
Signed-off-by: David Freilich <dfreilich@vmware.com>
@dfreilich dfreilich merged commit e2862fd into main Feb 10, 2021
@dfreilich dfreilich deleted the no-color-terminal branch February 10, 2021 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pack should use the --no-color equivelant when its not attached to a terminal
2 participants