Skip to content

Commit 94a773a

Browse files
style: auto-fix linting issues
1 parent 5d585d9 commit 94a773a

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

codeflash/languages/base.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
# This allows `from codeflash.languages.base import FunctionInfo` to work at runtime
3131
def __getattr__(name: str) -> Any:
3232
if name == "FunctionInfo":
33-
from codeflash.discovery.functions_to_optimize import \
34-
FunctionToOptimize
33+
from codeflash.discovery.functions_to_optimize import FunctionToOptimize
3534

3635
return FunctionToOptimize
3736
msg = f"module {__name__!r} has no attribute {name!r}"
@@ -174,18 +173,18 @@ class FunctionFilterCriteria:
174173
include_methods: bool = True
175174
min_lines: int | None = None
176175
max_lines: int | None = None
177-
178-
def __post_init__(self):
176+
177+
def __post_init__(self) -> None:
179178
"""Pre-compile regex patterns from glob patterns for faster matching."""
180179
self._include_regexes = [re.compile(fnmatch.translate(p)) for p in self.include_patterns]
181180
self._exclude_regexes = [re.compile(fnmatch.translate(p)) for p in self.exclude_patterns]
182-
181+
183182
def matches_include_patterns(self, name: str) -> bool:
184183
"""Check if name matches any include pattern."""
185184
if not self._include_regexes:
186185
return True
187186
return any(regex.match(name) for regex in self._include_regexes)
188-
187+
189188
def matches_exclude_patterns(self, name: str) -> bool:
190189
"""Check if name matches any exclude pattern."""
191190
if not self._exclude_regexes:

codeflash/languages/java/discovery.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
from codeflash.models.function_types import FunctionParent
1717

1818
if TYPE_CHECKING:
19+
from tree_sitter import Node
20+
1921
from codeflash.languages.java.parser import JavaAnalyzer, JavaMethodNode
2022

2123
logger = logging.getLogger(__name__)
@@ -199,7 +201,7 @@ def discover_test_methods(file_path: Path, analyzer: JavaAnalyzer | None = None)
199201

200202

201203
def _walk_tree_for_test_methods(
202-
node,
204+
node: Node,
203205
source_bytes: bytes,
204206
file_path: Path,
205207
test_methods: list[FunctionToOptimize],

0 commit comments

Comments
 (0)