Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit d8ab1f6

Browse files
committed
fix types
1 parent 3af0a88 commit d8ab1f6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

flake8_idom_hooks/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
)
55

66
try:
7-
__version__ = _get_distribution(__name__).version
7+
__version__: str = _get_distribution(__name__).version
88
except _DistributionNotFound: # pragma: no cover
99
# package is not installed
1010
__version__ = "0.0.0"

flake8_idom_hooks/exhaustive_deps.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def visit_FunctionDef(self, node: ast.FunctionDef) -> None:
3636
for kw in deco.keywords:
3737
if kw.arg == "args":
3838
self._check_hook_dependency_list_is_exhaustive(
39+
self._current_hook_or_element,
3940
called_func_name,
4041
node,
4142
kw.value,
@@ -74,13 +75,15 @@ def visit_Call(self, node: ast.Call) -> None:
7475

7576
if isinstance(func, ast.Lambda):
7677
self._check_hook_dependency_list_is_exhaustive(
78+
self._current_hook_or_element,
7779
called_func_name,
7880
func,
7981
args,
8082
)
8183

8284
def _check_hook_dependency_list_is_exhaustive(
8385
self,
86+
current_hook_or_element: ast.FunctionDef,
8487
hook_name: str,
8588
func: Union[ast.FunctionDef, ast.Lambda],
8689
dependency_expr: Optional[ast.expr],
@@ -95,7 +98,7 @@ def _check_hook_dependency_list_is_exhaustive(
9598
func_name = "lambda" if isinstance(func, ast.Lambda) else func.name
9699

97100
top_level_variable_finder = _TopLevelVariableFinder()
98-
top_level_variable_finder.visit(self._current_hook_or_element)
101+
top_level_variable_finder.visit(current_hook_or_element)
99102
variables_defined_in_scope = top_level_variable_finder.variable_names
100103

101104
missing_name_finder = _MissingNameFinder(

0 commit comments

Comments
 (0)