mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-22 03:15:44 +00:00
Detect runtime-evaluated base classes defined in the current file (#8572)
Closes https://github.com/astral-sh/ruff/issues/8250. Closes https://github.com/astral-sh/ruff/issues/5486.
This commit is contained in:
parent
4760af3dcb
commit
722687ad72
10 changed files with 103 additions and 0 deletions
|
@ -686,6 +686,16 @@ impl<'a> SemanticModel<'a> {
|
|||
Some(resolved)
|
||||
}
|
||||
BindingKind::Builtin => Some(smallvec!["", head.id.as_str()]),
|
||||
BindingKind::ClassDefinition(_) | BindingKind::FunctionDefinition(_) => {
|
||||
let value_path = collect_call_path(value)?;
|
||||
let resolved: CallPath = self
|
||||
.module_path?
|
||||
.iter()
|
||||
.map(String::as_str)
|
||||
.chain(value_path)
|
||||
.collect();
|
||||
Some(resolved)
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue