Skip to content

Commit 8d74b26

Browse files
fix: resolve mypy type errors
1 parent 7f570be commit 8d74b26

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

codeflash/languages/java/remove_asserts.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
from codeflash.languages.java.parser import get_java_analyzer
2424

2525
if TYPE_CHECKING:
26+
from tree_sitter import Node
27+
2628
from codeflash.discovery.functions_to_optimize import FunctionToOptimize
2729
from codeflash.languages.java.parser import JavaAnalyzer
2830

@@ -548,7 +550,7 @@ def _extract_target_calls(self, content: str, base_offset: int) -> list[TargetCa
548550

549551
def _collect_target_invocations(
550552
self,
551-
node,
553+
node: Node,
552554
wrapper_bytes: bytes,
553555
content_bytes: bytes,
554556
base_offset: int,
@@ -601,7 +603,7 @@ def _collect_target_invocations(
601603
self._collect_target_invocations(child, wrapper_bytes, content_bytes, base_offset, out, seen_top_level)
602604

603605
def _build_target_call(
604-
self, node, wrapper_bytes: bytes, content_bytes: bytes, start_byte: int, end_byte: int, base_offset: int
606+
self, node: Node, wrapper_bytes: bytes, content_bytes: bytes, start_byte: int, end_byte: int, base_offset: int
605607
) -> TargetCall:
606608
"""Build a TargetCall from a tree-sitter method_invocation node."""
607609
object_node = node.child_by_field_name("object")
@@ -634,7 +636,7 @@ def _build_target_call(
634636
end_pos=base_offset + end_char,
635637
)
636638

637-
def _find_top_level_arg_node(self, target_node, wrapper_bytes: bytes):
639+
def _find_top_level_arg_node(self, target_node: Node, wrapper_bytes: bytes) -> Node | None:
638640
"""Find the top-level argument expression containing a nested target call.
639641
640642
Walks up the AST from target_node to the wrapper _d() call's argument_list.

0 commit comments

Comments
 (0)