Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

Commit 258fe85

Browse files
authored
Merge pull request #10 from knitli/chore/remove-unused-nodes-argument-18343041253122866935
🧹 refactor: remove unused `nodes` argument in `validator.py`
2 parents efcb779 + 89544af commit 258fe85

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/exportify/validator/validator.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ def _check_structure_and_imports(
139139
if not isinstance(tree, ast.Module):
140140
return has_type_checking_block, has_lateimport_calls
141141

142-
for i, node in enumerate(tree.body):
142+
for node in tree.body:
143143
is_import = isinstance(node, (ast.Import, ast.ImportFrom))
144144
is_code = self._is_code_statement(node, is_import=is_import)
145145

146-
if is_import and seen_code and not self._is_type_checking_block(tree.body[:i]):
146+
if is_import and seen_code:
147147
issues.append(
148148
ValidationWarning(
149149
file=file_path,
@@ -514,15 +514,12 @@ def _is_type_checking_guard(self, node: ast.If) -> bool:
514514
"""
515515
return isinstance(node.test, ast.Name) and node.test.id == "TYPE_CHECKING"
516516

517-
def _is_type_checking_block(self, nodes: list[ast.stmt]) -> bool:
517+
def _is_type_checking_block(self) -> bool:
518518
"""Check if we're currently in a TYPE_CHECKING block.
519519
520520
This is a simplified check - it just looks for any TYPE_CHECKING if in the nodes.
521521
More sophisticated tracking would be needed for nested structures.
522522
523-
Args:
524-
nodes: List of AST nodes to check (body up to current position)
525-
526523
Returns:
527524
True if there's a TYPE_CHECKING block in the nodes (simplified)
528525
"""

0 commit comments

Comments
 (0)