Skip to content

Commit 5cace28

Browse files
authored
[ty] Add warning for unknown TY_MEMORY_REPORT value (astral-sh#19465)
1 parent 3785e13 commit 5cace28

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/ty/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,12 @@ fn run_check(args: CheckCommand) -> anyhow::Result<ExitStatus> {
156156
Ok("short") => write!(stdout, "{}", db.salsa_memory_dump().display_short())?,
157157
Ok("mypy_primer") => write!(stdout, "{}", db.salsa_memory_dump().display_mypy_primer())?,
158158
Ok("full") => write!(stdout, "{}", db.salsa_memory_dump().display_full())?,
159-
_ => {}
159+
Ok(other) => {
160+
tracing::warn!(
161+
"Unknown value for `TY_MEMORY_REPORT`: `{other}`. Valid values are `short`, `mypy_primer`, and `full`."
162+
);
163+
}
164+
Err(_) => {}
160165
}
161166

162167
std::mem::forget(db);

0 commit comments

Comments
 (0)