Skip to content

Add support for color diagnostics. #274

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

Merged
merged 1 commit into from
Nov 13, 2021
Merged

Conversation

allevato
Copy link
Member

By default, the diagnostic printer will detect whether stderr is
connected to a TTY and use ANSI color sequences if so. We use the
same colors that swiftc uses for its diagnostics: white for the
main text, red for error labels, magenta for warning labels, and
gray for note labels. Additionally, we use yellow to emphasize the
finding category for diagnostics that come from linter findings.

This behavior can be controlled manually using the
--color-diagnostics/--no-color-diagnostics flag pair.

By default, the diagnostic printer will detect whether stderr is
connected to a TTY and use ANSI color sequences if so. We use the
same colors that `swiftc` uses for its diagnostics: white for the
main text, red for error labels, magenta for warning labels, and
gray for note labels. Additionally, we use yellow to emphasize the
finding category for diagnostics that come from linter findings.

This behavior can be controlled manually using the
`--color-diagnostics/--no-color-diagnostics` flag pair.
@allevato
Copy link
Member Author

cc @dylansturg

@allevato allevato merged commit e23f8eb into swiftlang:main Nov 13, 2021
@allevato allevato deleted the rainbow branch November 13, 2021 00:15
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.

2 participants