Skip to content

Commit 6c9bf65

Browse files
committed
uvx ruff check .
1 parent 16a4d3c commit 6c9bf65

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

codeflash/cli_cmds/cli_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def inquirer_wrapper_path(*args: str, **kwargs: str) -> dict[str, str] | None:
7474
new_kwargs["message"] = last_message
7575
new_args.append(args[0])
7676

77-
return cast(dict[str, str], inquirer.prompt([inquirer.Path(*new_args, **new_kwargs)]))
77+
return cast("dict[str, str]", inquirer.prompt([inquirer.Path(*new_args, **new_kwargs)]))
7878

7979

8080
def split_string_to_fit_width(string: str, width: int) -> list[str]:

codeflash/cli_cmds/cmd_init.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ def ask_run_end_to_end_test(args: Namespace) -> None:
124124
run_end_to_end_test(args, bubble_sort_path, bubble_sort_test_path)
125125

126126
def should_modify_pyproject_toml() -> bool:
127-
"""
128-
Check if the current directory contains a valid pyproject.toml file with codeflash config
127+
"""Check if the current directory contains a valid pyproject.toml file with codeflash config
129128
If it does, ask the user if they want to re-configure it.
130129
"""
131130
from rich.prompt import Confirm
@@ -134,7 +133,7 @@ def should_modify_pyproject_toml() -> bool:
134133
return True
135134
try:
136135
config, config_file_path = parse_config_file(pyproject_toml_path)
137-
except Exception as e:
136+
except Exception:
138137
return True
139138

140139
if "module_root" not in config or config["module_root"] is None or not Path(config["module_root"]).is_dir():
@@ -143,7 +142,7 @@ def should_modify_pyproject_toml() -> bool:
143142
return True
144143

145144
create_toml = Confirm.ask(
146-
f"✅ A valid Codeflash config already exists in this project. Do you want to re-configure it?", default=False, show_default=True
145+
"✅ A valid Codeflash config already exists in this project. Do you want to re-configure it?", default=False, show_default=True
147146
)
148147
return create_toml
149148

@@ -224,7 +223,7 @@ def collect_setup_info() -> SetupInfo:
224223
else:
225224
apologize_and_exit()
226225
else:
227-
tests_root = Path(curdir) / Path(cast(str, tests_root_answer))
226+
tests_root = Path(curdir) / Path(cast("str", tests_root_answer))
228227
tests_root = tests_root.relative_to(curdir)
229228
ph("cli-tests-root-provided")
230229

@@ -278,9 +277,9 @@ def collect_setup_info() -> SetupInfo:
278277
return SetupInfo(
279278
module_root=str(module_root),
280279
tests_root=str(tests_root),
281-
test_framework=cast(str, test_framework),
280+
test_framework=cast("str", test_framework),
282281
ignore_paths=ignore_paths,
283-
formatter=cast(str, formatter),
282+
formatter=cast("str", formatter),
284283
git_remote=str(git_remote),
285284
)
286285

@@ -390,7 +389,7 @@ def check_for_toml_or_setup_file() -> str | None:
390389
click.echo("⏩️ Skipping pyproject.toml creation.")
391390
apologize_and_exit()
392391
click.echo()
393-
return cast(str, project_name)
392+
return cast("str", project_name)
394393

395394

396395
def install_github_actions(override_formatter_check: bool = False) -> None:

codeflash/discovery/functions_to_optimize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def get_all_replay_test_functions(
300300
if valid_function.qualified_name == function_name
301301
]
302302
)
303-
if len(filtered_list):
303+
if filtered_list:
304304
filtered_valid_functions[file_path] = filtered_list
305305

306306
return filtered_valid_functions

codeflash/models/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ def __eq__(self, other: object) -> bool:
527527
if len(self) != len(other):
528528
return False
529529
original_recursion_limit = sys.getrecursionlimit()
530-
cast(TestResults, other)
530+
cast("TestResults", other)
531531
for test_result in self:
532532
other_test_result = other.get_by_unique_invocation_loop_id(test_result.unique_invocation_loop_id)
533533
if other_test_result is None:

0 commit comments

Comments
 (0)