Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ repos:
- id: check-github-workflows
- id: check-github-actions
- id: check-readthedocs
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
args:
- --ignore-words-list=HAX,ccompiler,ot,statics,whet,zar
exclude: ^(mypy/test/|mypy/typeshed/|mypyc/test-data/|test-data/).+$
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
hooks:
Expand Down
4 changes: 2 additions & 2 deletions mypy/fastparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def from_operator(self, op: ast3.operator) -> str:
ast3.Is: "is",
ast3.IsNot: "is not",
ast3.In: "in",
ast3.NotIn: "not in",
ast3.NotIn: "not in", # codespell:ignore notin
}

def from_comp_operator(self, op: ast3.cmpop) -> str:
Expand Down Expand Up @@ -2169,7 +2169,7 @@ def visit_member_expr(self, e: MemberExpr) -> None:


class FindYield(TraverserVisitor):
"""Check if an AST contains yields or yield froms."""
"""Check if an AST contains yields or yield froms.""" # codespell:ignore froms

def __init__(self) -> None:
self.found = False
Expand Down
12 changes: 6 additions & 6 deletions mypy/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ class Node(Context):
__slots__ = ()

def __str__(self) -> str:
ans = self.accept(mypy.strconv.StrConv(options=Options()))
if ans is None:
a = self.accept(mypy.strconv.StrConv(options=Options()))
if a is None:
return repr(self)
return ans
return a

def str_with_options(self, options: Options) -> str:
ans = self.accept(mypy.strconv.StrConv(options=options))
assert ans
return ans
a = self.accept(mypy.strconv.StrConv(options=options))
assert a
return a

def accept(self, visitor: NodeVisitor[T]) -> T:
raise RuntimeError("Not implemented", type(self))
Expand Down
2 changes: 1 addition & 1 deletion mypy/stubinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def stub_distribution_name(module: str) -> str | None:
"commctrl": "types-pywin32",
"commonmark": "types-commonmark",
"consolemenu": "types-console-menu",
"corus": "types-corus",
"corus": "types-corus", # codespell:ignore corus
"cronlog": "types-python-crontab",
"crontab": "types-python-crontab",
"crontabs": "types-python-crontab",
Expand Down