[red-knot] Diagnostics for incorrect bool usages (#16238)

This commit is contained in:
Micha Reiser 2025-02-21 18:26:05 +00:00 committed by GitHub
parent 3aa7ba31b1
commit 5fab97f1ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 1267 additions and 260 deletions

View file

@ -595,6 +595,10 @@ impl<'s> Parser<'s> {
return self.process_config_block(code);
}
if lang == "ignore" {
return Ok(());
}
if let Some(explicit_path) = self.explicit_path {
if !lang.is_empty()
&& lang != "text"
@ -618,7 +622,7 @@ impl<'s> Parser<'s> {
EmbeddedFilePath::Explicit(path)
}
None => match lang {
"py" => EmbeddedFilePath::Autogenerated(PySourceType::Python),
"py" | "python" => EmbeddedFilePath::Autogenerated(PySourceType::Python),
"pyi" => EmbeddedFilePath::Autogenerated(PySourceType::Stub),
"" => {
bail!("Cannot auto-generate file name for code block with empty language specifier in test `{test_name}`");