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

✨ Add --no-color flag #449

Merged
merged 1 commit into from
Jun 30, 2022
Merged

✨ Add --no-color flag #449

merged 1 commit into from
Jun 30, 2022

Conversation

genevieveluyt
Copy link
Contributor

Description

Adds --no-color flag which can be used to disable printing color codes in the output. Colored output is intended for stdout but displays poorly elsewhere.

For example, redirecting the default "pretty" output to a file:

�[36m
---------------- Results for ---------------

�[0m�[36m  apiVersion: v1
�[0m�[36m  kind: Namespace
�[0m�[36m  metadata:
�[0m�[36m    name: deployment-apps-v1
�[0m�[36m
--------------------------------------------
Type of change
  • Bug fix 🐛
  • New feature ✨
  • This change requires a documentation update 📖
  • Breaking changes ⚠️
How Has This Been Tested?
  • Ran go run cmd/main.go all -f "internal/test/fixtures/all_resources/deployment-apps-v1.yml" > out.txt and compared it with go run cmd/main.go all --no-color -f "internal/test/fixtures/all_resources/deployment-apps-v1.yml" > out.txt
Checklist:
  • I have 🎩 my changes (A 🎩 specifically includes pulling down changes, setting them up, and manually testing the changed features and potential side effects to make sure nothing is broken)
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The test coverage did not decrease
  • I have signed the appropriate Contributor License Agreement

Comment on lines +170 to +172
- `Error`: A security issue or invalid kubernetes configuration
- `Warning`: A best practice recommendation
- `Info`: Informational, no action required. This includes results that are [overridden](#override-errors)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an unrelated change, just improves the formatting by separating them severity codes by newlines

Copy link
Member

@Owen-Cummings Owen-Cummings left a comment

Choose a reason for hiding this comment

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

As a Canadian: Color vs Colour 👀 But otherwise :shipit:

@genevieveluyt
Copy link
Contributor Author

@Owen-Cummings it pains me to not use colour haha

@genevieveluyt
Copy link
Contributor Author

The failing CLA check is due to a bug. Since there's no ETA to fix, we've got the ok to merge through the failing check (Shopify employees don't have to sign the CLA, they should always pass the check).

@genevieveluyt genevieveluyt merged commit dbeb9b5 into main Jun 30, 2022
@genevieveluyt genevieveluyt deleted the no-color-flag branch June 30, 2022 17:08
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.

None yet

3 participants