Add mypy error codes to type: ignores, remove unused ignores (#7504)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Alex Waygood
2022-03-19 13:10:00 +00:00
committed by GitHub
parent 4308915e06
commit 340c6c97ed
67 changed files with 159 additions and 150 deletions

View File

@@ -27,14 +27,14 @@ class Expression(StrAndRepr):
class Literal(Expression):
literal: str
identity_tuple: tuple[str, str] # type: ignore
identity_tuple: tuple[str, str] # type: ignore[assignment]
def __init__(self, literal: str, name: str = ...) -> None: ...
class TokenMatcher(Literal): ...
class Regex(Expression):
re: Pattern[str]
identity_tuple: tuple[str, Pattern[str]] # type: ignore
identity_tuple: tuple[str, Pattern[str]] # type: ignore[assignment]
def __init__(
self,
pattern: str,

View File

@@ -44,7 +44,7 @@ class RuleVisitor(NodeVisitor):
def visit_spaceless_literal(self, spaceless_literal: Node, visited_children: typing.Sequence[Any]) -> Literal: ...
def visit_regex(self, node: Node, regex: typing.Sequence[Any]) -> Regex: ...
def visit_parenthesized(self, node: Node, parenthesized: typing.Sequence[Any]) -> Expression: ...
def generic_visit(self, node: Node, visited_children: typing.Sequence[Any]) -> typing.Sequence[Any] | Node: ... # type: ignore
def generic_visit(self, node: Node, visited_children: typing.Sequence[Any]) -> typing.Sequence[Any] | Node: ... # type: ignore[override]
class TokenRuleVisitor(RuleVisitor):
def visit_spaceless_literal(self, spaceless_literal: Node, visited_children: typing.Sequence[Any]) -> TokenMatcher: ...