-
Notifications
You must be signed in to change notification settings - Fork 3
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
[#237] Modify coloring options #268
Conversation
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.
Good 👍
Leaving one comment, but it's arguable, feel free to ignore it.
src/Xrefcheck/CLI.hs
Outdated
[ flag' (Just WithColors) $ | ||
long "color" <> | ||
help "Enable ANSI coloring of output. \ | ||
\This is enabled by default when `CI` env var is set to true." |
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.
Very good that you included this clarification. However I read it like: "it is enabled if and only if CI
env var is set to true" 🤔
Maybe say it differently, like "When CI
env var is set to true, this option will be enabled by default". I only swapped the sub-sentences, but to me it seems like avoiding the ambiguity.
I may be wrong about all this though.
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.
@Martoon-00 I have clarified the option description, and also included some tests regarding the new behavior in CI.
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.
Neat.
Leaving one more comment, but also feel free to ignore it.
- anchors: | ||
- color ([2m[92mheader I[0m[0m) [2mat src:7:1-7[0m | ||
|
||
All repository links are valid. |
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.
Yeah, I think this format is just the best ))
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.
Yeah 😆, as you may have seen in the commit history, I was trying to store this in a textual representation of the output's binary data, but encountered a lot of problems, mainly:
- Different behaviour, parameters and output on macOS and linux commands.
- Different Windows newline character.
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.
Ugh, that sounds like a sufferring 😋
6614033
to
6e37c94
Compare
Problem: We noticed that output was not being colorized in GitLab CI due to the current implemented guesses for whether showing colors or not. Solution: On the one hand, we extend the current guesses to also enable coloring by default when the CI env var is set to true. On the other hand, we also add a new flag, color, which avoids these guesses and enables colors.
6e37c94
to
29c1ab1
Compare
Description
Problem: We noticed that output was not being colorized in GitLab CI due to the current implemented guesses for whether showing colors or not.
Solution: On the one hand, we extend the current guesses to also enable coloring by default when the CI env var is set to true. On the other hand, we also add a new flag, color, which avoids these guesses and enables colors.
I have tried in a GitLab CI project and the output is colored now.
Related issue(s)
Fixes #237
✅ Checklist for your Pull Request
Related changes (conditional)
Tests
silently reappearing again.
Documentation
Public contracts
of Public Contracts policy.
and
Stylistic guide (mandatory)