mirror of
https://github.com/codeflash-ai/codeflash.git
synced 2026-05-04 18:25:17 +00:00
and fix it
This commit is contained in:
parent
11b281c50a
commit
733daaf2d7
7 changed files with 13 additions and 9 deletions
|
|
@ -32,12 +32,14 @@ class AddDecoratorTransformer(cst.CSTTransformer):
|
|||
def visit_ClassDef(self, node: ClassDef) -> Optional[bool]:
|
||||
if self.class_name: # Don't go into nested class
|
||||
return False
|
||||
self.class_name = node.name.value # noqa: RET503
|
||||
self.class_name = node.name.value
|
||||
return None
|
||||
|
||||
def visit_FunctionDef(self, node: FunctionDef) -> Optional[bool]:
|
||||
if self.function_name: # Don't go into nested function
|
||||
return False
|
||||
self.function_name = node.name.value # noqa: RET503
|
||||
self.function_name = node.name.value
|
||||
return None
|
||||
|
||||
def leave_FunctionDef(self, original_node: FunctionDef, updated_node: FunctionDef) -> FunctionDef:
|
||||
if self.function_name == original_node.name.value:
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ if TYPE_CHECKING:
|
|||
from argparse import Namespace
|
||||
|
||||
CODEFLASH_LOGO: str = (
|
||||
f"{LF}" # noqa: ISC003
|
||||
f"{LF}"
|
||||
r" _ ___ _ _ " + f"{LF}"
|
||||
r" | | / __)| | | | " + f"{LF}"
|
||||
r" ____ ___ _ | | ____ | |__ | | ____ ___ | | _ " + f"{LF}"
|
||||
|
|
|
|||
|
|
@ -480,7 +480,7 @@ class FunctionTestInvocation:
|
|||
return f"{self.loop_index}:{self.id.id()}"
|
||||
|
||||
|
||||
class TestResults(BaseModel):
|
||||
class TestResults(BaseModel): # noqa: PLW1641
|
||||
# don't modify these directly, use the add method
|
||||
# also we don't support deletion of test results elements - caution is advised
|
||||
test_results: list[FunctionTestInvocation] = []
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from codeflash.cli_cmds.console import logger
|
||||
from codeflash.code_utils import env_utils
|
||||
|
|
@ -29,7 +29,8 @@ def speedup_critic(
|
|||
candidate_result: OptimizedCandidateResult,
|
||||
original_code_runtime: int,
|
||||
best_runtime_until_now: int | None,
|
||||
disable_gh_action_noise: Optional[bool] = None,
|
||||
*,
|
||||
disable_gh_action_noise: bool = False,
|
||||
) -> bool:
|
||||
"""Take in a correct optimized Test Result and decide if the optimization should actually be surfaced to the user.
|
||||
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ def parse_test_xml(
|
|||
groups = match.groups()
|
||||
if len(groups[5].split(":")) > 1:
|
||||
iteration_id = groups[5].split(":")[0]
|
||||
groups = groups[:5] + (iteration_id,)
|
||||
groups = (*groups[:5], iteration_id)
|
||||
end_matches[groups] = match
|
||||
|
||||
if not begin_matches or not begin_matches:
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
# These version placeholders will be replaced by uv-dynamic-versioning during build.
|
||||
__version__ = "0.16.1"
|
||||
__version__ = "0.16.1.post16.dev0+11b281c5"
|
||||
|
|
|
|||
|
|
@ -239,7 +239,8 @@ ignore = [
|
|||
"D104",
|
||||
"PERF203",
|
||||
"LOG015",
|
||||
"PLC0415"
|
||||
"PLC0415",
|
||||
"UP045"
|
||||
]
|
||||
|
||||
[tool.ruff.lint.flake8-type-checking]
|
||||
|
|
|
|||
Loading…
Reference in a new issue