Skip to content

Commit 3ef3320

Browse files
committed
go
1 parent 039d5db commit 3ef3320

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

codeflash/api/aiservice.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def make_ai_service_request(
7373
# response.raise_for_status() # Will raise an HTTPError if the HTTP request returned an unsuccessful status code
7474
return response
7575

76-
def optimize_python_code(
76+
def optimize_python_code( # noqa: D417
7777
self,
7878
source_code: str,
7979
dependency_code: str,
@@ -139,7 +139,7 @@ def optimize_python_code(
139139
console.rule()
140140
return []
141141

142-
def optimize_python_code_line_profiler(
142+
def optimize_python_code_line_profiler( # noqa: D417
143143
self,
144144
source_code: str,
145145
dependency_code: str,
@@ -208,7 +208,7 @@ def optimize_python_code_line_profiler(
208208
console.rule()
209209
return []
210210

211-
def log_results(
211+
def log_results( # noqa: D417
212212
self,
213213
function_trace_id: str,
214214
speedup_ratio: dict[str, float | None] | None,
@@ -240,7 +240,7 @@ def log_results(
240240
except requests.exceptions.RequestException as e:
241241
logger.exception(f"Error logging features: {e}")
242242

243-
def generate_regression_tests(
243+
def generate_regression_tests( # noqa: D417
244244
self,
245245
source_code_being_tested: str,
246246
function_to_optimize: FunctionToOptimize,
@@ -307,7 +307,7 @@ def generate_regression_tests(
307307
error = response.json()["error"]
308308
logger.error(f"Error generating tests: {response.status_code} - {error}")
309309
ph("cli-testgen-error-response", {"response_status_code": response.status_code, "error": error})
310-
return None
310+
return None # noqa: TRY300
311311
except Exception:
312312
logger.error(f"Error generating tests: {response.status_code} - {response.text}")
313313
ph("cli-testgen-error-response", {"response_status_code": response.status_code, "error": response.text})

codeflash/cli_cmds/cmd_init.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from argparse import Namespace
3535

3636
CODEFLASH_LOGO: str = (
37-
f"{LF}"
37+
f"{LF}" # noqa: ISC003
3838
r" _ ___ _ _ " + f"{LF}"
3939
r" | | / __)| | | | " + f"{LF}"
4040
r" ____ ___ _ | | ____ | |__ | | ____ ___ | | _ " + f"{LF}"
@@ -126,7 +126,8 @@ def ask_run_end_to_end_test(args: Namespace) -> None:
126126

127127

128128
def should_modify_pyproject_toml() -> bool:
129-
"""Check if the current directory contains a valid pyproject.toml file with codeflash config
129+
"""Check if the current directory contains a valid pyproject.toml file with codeflash config.
130+
130131
If it does, ask the user if they want to re-configure it.
131132
"""
132133
from rich.prompt import Confirm
@@ -468,7 +469,7 @@ def check_for_toml_or_setup_file() -> str | None:
468469
return cast("str", project_name)
469470

470471

471-
def install_github_actions(override_formatter_check: bool = False) -> None:
472+
def install_github_actions(override_formatter_check: bool = False) -> None: # noqa: FBT001, FBT002
472473
try:
473474
config, config_file_path = parse_config_file(override_formatter_check=override_formatter_check)
474475

@@ -563,7 +564,7 @@ def install_github_actions(override_formatter_check: bool = False) -> None:
563564
apologize_and_exit()
564565

565566

566-
def determine_dependency_manager(pyproject_data: dict[str, Any]) -> DependencyManager:
567+
def determine_dependency_manager(pyproject_data: dict[str, Any]) -> DependencyManager: # noqa: PLR0911
567568
"""Determine which dependency manager is being used based on pyproject.toml contents."""
568569
if (Path.cwd() / "poetry.lock").exists():
569570
return DependencyManager.POETRY
@@ -641,7 +642,10 @@ def get_github_action_working_directory(toml_path: Path, git_root: Path) -> str:
641642

642643

643644
def customize_codeflash_yaml_content(
644-
optimize_yml_content: str, config: tuple[dict[str, Any], Path], git_root: Path, benchmark_mode: bool = False
645+
optimize_yml_content: str,
646+
config: tuple[dict[str, Any], Path],
647+
git_root: Path,
648+
benchmark_mode: bool = False, # noqa: FBT001, FBT002
645649
) -> str:
646650
module_path = str(Path(config["module_root"]).relative_to(git_root) / "**")
647651
optimize_yml_content = optimize_yml_content.replace("{{ codeflash_module_path }}", module_path)
@@ -877,7 +881,7 @@ def test_sort(self):
877881
input = list(reversed(range(100)))
878882
output = sorter(input)
879883
self.assertEqual(output, list(range(100)))
880-
"""
884+
""" # noqa: PTH119
881885
elif args.test_framework == "pytest":
882886
bubble_sort_test_content = f"""from {Path(args.module_root).name}.bubble_sort import sorter
883887

0 commit comments

Comments
 (0)