Skip to content

Commit 373fe8a

Browse files
authored
[ty] Remove 'pre-release software' warning (#20817)
1 parent 975891f commit 373fe8a

File tree

7 files changed

+260
-400
lines changed

7 files changed

+260
-400
lines changed

crates/ty/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ fn run_check(args: CheckCommand) -> anyhow::Result<ExitStatus> {
7373

7474
let printer = Printer::default().with_verbosity(verbosity);
7575

76-
tracing::warn!(
77-
"ty is pre-release software and not ready for production use. \
78-
Expect to encounter bugs, missing features, and fatal errors.",
79-
);
80-
8176
tracing::debug!("Version: {}", version::version());
8277

8378
// The base path to which all CLI arguments are relative to.

crates/ty/tests/cli/config_option.rs

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fn cli_config_args_toml_string_basic() -> anyhow::Result<()> {
77
let case = CliTest::with_file("test.py", r"print(x) # [unresolved-reference]")?;
88

99
// Long flag
10-
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference").arg("--config").arg("terminal.error-on-warning=true"), @r"
10+
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference").arg("--config").arg("terminal.error-on-warning=true"), @r###"
1111
success: false
1212
exit_code: 1
1313
----- stdout -----
@@ -22,11 +22,10 @@ fn cli_config_args_toml_string_basic() -> anyhow::Result<()> {
2222
Found 1 diagnostic
2323
2424
----- stderr -----
25-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
26-
");
25+
"###);
2726

2827
// Short flag
29-
assert_cmd_snapshot!(case.command().arg("-c").arg("terminal.error-on-warning=true"), @r"
28+
assert_cmd_snapshot!(case.command().arg("-c").arg("terminal.error-on-warning=true"), @r###"
3029
success: false
3130
exit_code: 1
3231
----- stdout -----
@@ -41,8 +40,7 @@ fn cli_config_args_toml_string_basic() -> anyhow::Result<()> {
4140
Found 1 diagnostic
4241
4342
----- stderr -----
44-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
45-
");
43+
"###);
4644

4745
Ok(())
4846
}
@@ -61,7 +59,7 @@ fn cli_config_args_overrides_ty_toml() -> anyhow::Result<()> {
6159
])?;
6260

6361
// Exit code of 1 due to the setting in `ty.toml`
64-
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference"), @r"
62+
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference"), @r###"
6563
success: false
6664
exit_code: 1
6765
----- stdout -----
@@ -76,11 +74,10 @@ fn cli_config_args_overrides_ty_toml() -> anyhow::Result<()> {
7674
Found 1 diagnostic
7775
7876
----- stderr -----
79-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
80-
");
77+
"###);
8178

8279
// Exit code of 0 because the `ty.toml` setting is overwritten by `--config`
83-
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference").arg("--config").arg("terminal.error-on-warning=false"), @r"
80+
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference").arg("--config").arg("terminal.error-on-warning=false"), @r###"
8481
success: true
8582
exit_code: 0
8683
----- stdout -----
@@ -95,16 +92,15 @@ fn cli_config_args_overrides_ty_toml() -> anyhow::Result<()> {
9592
Found 1 diagnostic
9693
9794
----- stderr -----
98-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
99-
");
95+
"###);
10096

10197
Ok(())
10298
}
10399

104100
#[test]
105101
fn cli_config_args_later_overrides_earlier() -> anyhow::Result<()> {
106102
let case = CliTest::with_file("test.py", r"print(x) # [unresolved-reference]")?;
107-
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference").arg("--config").arg("terminal.error-on-warning=true").arg("--config").arg("terminal.error-on-warning=false"), @r"
103+
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference").arg("--config").arg("terminal.error-on-warning=true").arg("--config").arg("terminal.error-on-warning=false"), @r###"
108104
success: true
109105
exit_code: 0
110106
----- stdout -----
@@ -119,8 +115,7 @@ fn cli_config_args_later_overrides_earlier() -> anyhow::Result<()> {
119115
Found 1 diagnostic
120116
121117
----- stderr -----
122-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
123-
");
118+
"###);
124119

125120
Ok(())
126121
}
@@ -165,7 +160,7 @@ fn config_file_override() -> anyhow::Result<()> {
165160
])?;
166161

167162
// Ensure flag works via CLI arg
168-
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference").arg("--config-file").arg("ty-override.toml"), @r"
163+
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference").arg("--config-file").arg("ty-override.toml"), @r###"
169164
success: false
170165
exit_code: 1
171166
----- stdout -----
@@ -180,11 +175,10 @@ fn config_file_override() -> anyhow::Result<()> {
180175
Found 1 diagnostic
181176
182177
----- stderr -----
183-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
184-
");
178+
"###);
185179

186180
// Ensure the flag works via an environment variable
187-
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference").env("TY_CONFIG_FILE", "ty-override.toml"), @r"
181+
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference").env("TY_CONFIG_FILE", "ty-override.toml"), @r###"
188182
success: false
189183
exit_code: 1
190184
----- stdout -----
@@ -199,8 +193,7 @@ fn config_file_override() -> anyhow::Result<()> {
199193
Found 1 diagnostic
200194
201195
----- stderr -----
202-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
203-
");
196+
"###);
204197

205198
Ok(())
206199
}

crates/ty/tests/cli/exit_code.rs

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::CliTest;
66
fn only_warnings() -> anyhow::Result<()> {
77
let case = CliTest::with_file("test.py", r"print(x) # [unresolved-reference]")?;
88

9-
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference"), @r"
9+
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference"), @r###"
1010
success: true
1111
exit_code: 0
1212
----- stdout -----
@@ -21,8 +21,7 @@ fn only_warnings() -> anyhow::Result<()> {
2121
Found 1 diagnostic
2222
2323
----- stderr -----
24-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
25-
");
24+
"###);
2625

2726
Ok(())
2827
}
@@ -37,7 +36,7 @@ fn only_info() -> anyhow::Result<()> {
3736
"#,
3837
)?;
3938

40-
assert_cmd_snapshot!(case.command(), @r"
39+
assert_cmd_snapshot!(case.command(), @r###"
4140
success: true
4241
exit_code: 0
4342
----- stdout -----
@@ -52,8 +51,7 @@ fn only_info() -> anyhow::Result<()> {
5251
Found 1 diagnostic
5352
5453
----- stderr -----
55-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
56-
");
54+
"###);
5755

5856
Ok(())
5957
}
@@ -68,7 +66,7 @@ fn only_info_and_error_on_warning_is_true() -> anyhow::Result<()> {
6866
"#,
6967
)?;
7068

71-
assert_cmd_snapshot!(case.command().arg("--error-on-warning"), @r"
69+
assert_cmd_snapshot!(case.command().arg("--error-on-warning"), @r###"
7270
success: true
7371
exit_code: 0
7472
----- stdout -----
@@ -83,8 +81,7 @@ fn only_info_and_error_on_warning_is_true() -> anyhow::Result<()> {
8381
Found 1 diagnostic
8482
8583
----- stderr -----
86-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
87-
");
84+
"###);
8885

8986
Ok(())
9087
}
@@ -93,7 +90,7 @@ fn only_info_and_error_on_warning_is_true() -> anyhow::Result<()> {
9390
fn no_errors_but_error_on_warning_is_true() -> anyhow::Result<()> {
9491
let case = CliTest::with_file("test.py", r"print(x) # [unresolved-reference]")?;
9592

96-
assert_cmd_snapshot!(case.command().arg("--error-on-warning").arg("--warn").arg("unresolved-reference"), @r"
93+
assert_cmd_snapshot!(case.command().arg("--error-on-warning").arg("--warn").arg("unresolved-reference"), @r###"
9794
success: false
9895
exit_code: 1
9996
----- stdout -----
@@ -108,8 +105,7 @@ fn no_errors_but_error_on_warning_is_true() -> anyhow::Result<()> {
108105
Found 1 diagnostic
109106
110107
----- stderr -----
111-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
112-
");
108+
"###);
113109

114110
Ok(())
115111
}
@@ -127,7 +123,7 @@ fn no_errors_but_error_on_warning_is_enabled_in_configuration() -> anyhow::Resul
127123
),
128124
])?;
129125

130-
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference"), @r"
126+
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference"), @r###"
131127
success: false
132128
exit_code: 1
133129
----- stdout -----
@@ -142,8 +138,7 @@ fn no_errors_but_error_on_warning_is_enabled_in_configuration() -> anyhow::Resul
142138
Found 1 diagnostic
143139
144140
----- stderr -----
145-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
146-
");
141+
"###);
147142

148143
Ok(())
149144
}
@@ -158,7 +153,7 @@ fn both_warnings_and_errors() -> anyhow::Result<()> {
158153
"#,
159154
)?;
160155

161-
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference"), @r"
156+
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference"), @r###"
162157
success: false
163158
exit_code: 1
164159
----- stdout -----
@@ -183,8 +178,7 @@ fn both_warnings_and_errors() -> anyhow::Result<()> {
183178
Found 2 diagnostics
184179
185180
----- stderr -----
186-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
187-
");
181+
"###);
188182

189183
Ok(())
190184
}
@@ -199,7 +193,7 @@ fn both_warnings_and_errors_and_error_on_warning_is_true() -> anyhow::Result<()>
199193
"###,
200194
)?;
201195

202-
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference").arg("--error-on-warning"), @r"
196+
assert_cmd_snapshot!(case.command().arg("--warn").arg("unresolved-reference").arg("--error-on-warning"), @r###"
203197
success: false
204198
exit_code: 1
205199
----- stdout -----
@@ -224,8 +218,7 @@ fn both_warnings_and_errors_and_error_on_warning_is_true() -> anyhow::Result<()>
224218
Found 2 diagnostics
225219
226220
----- stderr -----
227-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
228-
");
221+
"###);
229222

230223
Ok(())
231224
}
@@ -240,7 +233,7 @@ fn exit_zero_is_true() -> anyhow::Result<()> {
240233
"#,
241234
)?;
242235

243-
assert_cmd_snapshot!(case.command().arg("--exit-zero").arg("--warn").arg("unresolved-reference"), @r"
236+
assert_cmd_snapshot!(case.command().arg("--exit-zero").arg("--warn").arg("unresolved-reference"), @r###"
244237
success: true
245238
exit_code: 0
246239
----- stdout -----
@@ -265,8 +258,7 @@ fn exit_zero_is_true() -> anyhow::Result<()> {
265258
Found 2 diagnostics
266259
267260
----- stderr -----
268-
WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
269-
");
261+
"###);
270262

271263
Ok(())
272264
}

0 commit comments

Comments
 (0)