mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-17 09:00:26 +00:00
[flake8-type-checking
] Adds implementation for TC007 and TC008 (#12927)
Co-authored-by: Simon Brugman <sbrugman@users.noreply.github.com> Co-authored-by: Carl Meyer <carl@oddbird.net>
This commit is contained in:
parent
e0f3eaf1dd
commit
6fd10e2fe7
22 changed files with 1483 additions and 10 deletions
|
@ -85,6 +85,14 @@ impl ResolvedReference {
|
|||
self.flags
|
||||
.intersects(SemanticModelFlags::DUNDER_ALL_DEFINITION)
|
||||
}
|
||||
|
||||
/// Return `true` if the context is in the r.h.s. of a [PEP 613] type alias.
|
||||
///
|
||||
/// [PEP 613]: https://peps.python.org/pep-0613/
|
||||
pub const fn in_annotated_type_alias_value(&self) -> bool {
|
||||
self.flags
|
||||
.intersects(SemanticModelFlags::ANNOTATED_TYPE_ALIAS)
|
||||
}
|
||||
}
|
||||
|
||||
impl Ranged for ResolvedReference {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue