-
Notifications
You must be signed in to change notification settings - Fork 13.8k
refactor: Move to anstream + anstyle for styling #147207
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
base: master
Are you sure you want to change the base?
Conversation
The list of allowed third-party dependencies may have been modified! You must ensure that any new dependencies have compatible licenses before merging. These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This comment has been minimized.
This comment has been minimized.
21b6067
to
1f92a2f
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
rustc
usestermcolor
for styling and writing, whileannotate-snippets
usesanstyle
for styling and currently writes directly to aString
. When rendering directly to a terminal, there isn't/shouldn't be any differences. Still, there are differences in the escape sequences, which leads to slightly different output in JSON and SVG tests. As part of my work to haverustc
useannotate-snippets
, and to reduce the test differences between the two, I switchedrustc
to useanstlye
andanstream
for styling and writing.The first commit migrates to
anstyle
andanstream
and notably does not change the output. This is because it includes extra formatting to ensure thatanstyle
+anstream
match the current output exactly. Most of this code is unnecessary, as it adds redundant resets or uses 256-color (8-bit) when it could be using 4-bit color. The subsequent commits remove this extra formatting while maintaining the correct output when rendered.Zulip discussion