[ty] Add a warning about pre-release status to the CLI#17983
Merged
Conversation
ntBre
commented
May 9, 2025
Contributor
|
MichaReiser
reviewed
May 9, 2025
crates/ty/src/main.rs
Outdated
Comment on lines
11
to
17
| writeln!( | ||
| stderr, | ||
| "{warning}: ty is pre-release software and not ready for production use. \ | ||
| Expect to encounter bugs, missing features, and fatal errors.", | ||
| warning = "warning".yellow().bold() | ||
| ) | ||
| .ok(); |
Member
There was a problem hiding this comment.
I'd suggest to use tracing::warn! here. It's what we use for other warning messages (similar to ruff's warn! macro)
Contributor
Author
There was a problem hiding this comment.
Sounds good. Do we still want the colors? My first draft was just this message in tracing::warn but it didn't look as nice.
And setup_tracing is called in run_check, so should I only warn in there?
Member
There was a problem hiding this comment.
Contributor
Author
Member
There was a problem hiding this comment.
It's all nice in orange for me :)
Summary -- This was suggested on Discord, I hope this is roughly what we had in mind. I took the message from the ty README, but I'm more than happy to update it. Otherwise I just tried to mimic the appearance of the `ruff analyze graph` warning. Test Plan -- New warnings in the CLI tests. I thought this might be undesirable but it looks like uv did the same thing (astral-sh/uv#6166).
e4c8dbf to
0e9fe04
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
This was suggested on Discord, I hope this is roughly what we had in mind. I took the message from the ty README, but I'm more than happy to update it. Otherwise I just tried to mimic the appearance of the
ruff analyze graphwarning (although I'm realizing now the whole text is bold for ruff).Test Plan
New warnings in the CLI tests. I thought this might be undesirable but it looks like uv did the same thing (astral-sh/uv#6166).