Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Alter Checker.handleNodeLoad() signature #54

Merged
merged 3 commits into from Mar 23, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Expand Up @@ -8,13 +8,13 @@ repos:
- id: black

- repo: https://github.com/PyCQA/isort
rev: 5.9.2
rev: 5.11.5
hooks:
- id: isort
additional_dependencies: [toml]

- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
args: ["--max-line-length=88", "--extend-ignore=E203,E501"]
Expand Down
4 changes: 2 additions & 2 deletions src/mvdef/core/check.py
Expand Up @@ -115,7 +115,7 @@ def unused_imports(self) -> list[UnusedImport]:
imps = [m for m in self.messages if isinstance(m, UnusedImport)]
return imps

def handleNodeLoad(self, node):
def handleNodeLoad(self, node, parent=None):
used_set = [] # Note: not used, but would help if re-assignment is an issue
# https://github.com/PyCQA/pyflakes/blob/
# 853cce91634cbddff01cc16313b5467be1e95c54/pyflakes/checker.py#L1073-L1094
Expand All @@ -134,7 +134,7 @@ def handleNodeLoad(self, node):
continue
binding = scope.get(name, None)
if isinstance(binding, Annotation) and not self._in_postponed_annotation:
scope[name].used = True
scope[name].used = (self.scope, node)
continue
if name == "print" and isinstance(binding, Builtin):
parent = self.getParent(node)
Expand Down