mirror of https://github.com/astral-sh/ruff
Fix ExceptionGroup F821 false positive
This commit is contained in:
parent
4357f2be0f
commit
b6445de34d
|
|
@ -0,0 +1,4 @@
|
||||||
|
try:
|
||||||
|
pass
|
||||||
|
except ExceptionGroup:
|
||||||
|
pass
|
||||||
|
|
@ -102,6 +102,7 @@ mod tests {
|
||||||
#[test_case(Rule::UndefinedName, Path::new("F821_7.py"); "F821_7")]
|
#[test_case(Rule::UndefinedName, Path::new("F821_7.py"); "F821_7")]
|
||||||
#[test_case(Rule::UndefinedName, Path::new("F821_8.pyi"); "F821_8")]
|
#[test_case(Rule::UndefinedName, Path::new("F821_8.pyi"); "F821_8")]
|
||||||
#[test_case(Rule::UndefinedName, Path::new("F821_9.py"); "F821_9")]
|
#[test_case(Rule::UndefinedName, Path::new("F821_9.py"); "F821_9")]
|
||||||
|
#[test_case(Rule::UndefinedName, Path::new("F821_10.py"); "F821_10")]
|
||||||
#[test_case(Rule::UndefinedExport, Path::new("F822_0.py"); "F822_0")]
|
#[test_case(Rule::UndefinedExport, Path::new("F822_0.py"); "F822_0")]
|
||||||
#[test_case(Rule::UndefinedExport, Path::new("F822_1.py"); "F822_1")]
|
#[test_case(Rule::UndefinedExport, Path::new("F822_1.py"); "F822_1")]
|
||||||
#[test_case(Rule::UndefinedExport, Path::new("F822_2.py"); "F822_2")]
|
#[test_case(Rule::UndefinedExport, Path::new("F822_2.py"); "F822_2")]
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
source: crates/ruff/src/rules/pyflakes/mod.rs
|
||||||
|
expression: diagnostics
|
||||||
|
---
|
||||||
|
[]
|
||||||
|
|
||||||
|
|
@ -17,6 +17,7 @@ pub const BUILTINS: &[&str] = &[
|
||||||
"Ellipsis",
|
"Ellipsis",
|
||||||
"EnvironmentError",
|
"EnvironmentError",
|
||||||
"Exception",
|
"Exception",
|
||||||
|
"ExceptionGroup",
|
||||||
"False",
|
"False",
|
||||||
"FileExistsError",
|
"FileExistsError",
|
||||||
"FileNotFoundError",
|
"FileNotFoundError",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue