mirror of
https://github.com/astral-sh/ruff
synced 2026-01-10 16:15:19 -05:00
Add PYI034 for flake8-pyi plugin (#4764)
This commit is contained in:
@@ -89,6 +89,14 @@ pub fn is_property(
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns `true` if a class is an `final`.
|
||||
pub fn is_final(model: &SemanticModel, decorator_list: &[Expr]) -> bool {
|
||||
decorator_list
|
||||
.iter()
|
||||
.any(|expr| model.match_typing_expr(map_callable(expr), "final"))
|
||||
}
|
||||
|
||||
/// Returns `true` if a function is a "magic method".
|
||||
pub fn is_magic(name: &str) -> bool {
|
||||
name.starts_with("__") && name.ends_with("__")
|
||||
|
||||
@@ -93,6 +93,10 @@ impl<'a> SemanticModel<'a> {
|
||||
return true;
|
||||
}
|
||||
|
||||
if call_path.as_slice() == ["_typeshed", target] {
|
||||
return true;
|
||||
}
|
||||
|
||||
if TYPING_EXTENSIONS.contains(target) {
|
||||
if call_path.as_slice() == ["typing_extensions", target] {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user