Fail closed on git status and walk deep forms without recursion.

Status records are NUL-terminated, and a git failure returns git's status. .test.cts and .spec.cts are tests. Help lists every skipped directory.
This commit is contained in:
Robert C. Martin
2026-10-03 17:48:35 -05:00
parent c726bf0158
commit 2be6acadf5
8 changed files with 603 additions and 272 deletions
+5 -7
View File
@@ -73,8 +73,9 @@ def _rust_in_tests(data: bytes, node) -> bool:
def _java_nodes(data: bytes, root) -> list:
found = []
def visit(node) -> None:
stack = [root]
while stack:
node = stack.pop()
if node.type == "method_declaration":
nested = _inside(
node,
@@ -82,11 +83,8 @@ def _java_nodes(data: bytes, root) -> list:
)
if _has(node, "block") and not nested:
found.append(node)
return
for child in node.children:
visit(child)
visit(root)
continue
stack.extend(reversed(node.children))
return found