Skip to content

Commit 66207b5

Browse files
committed
linting mypy fixes
1 parent ba2cc51 commit 66207b5

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

codeflash/code_utils/edit_generated_tests.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ def leave_SimpleStatementLine(
161161
)
162162
rel_path = (
163163
Path(invocation_id.test_module_path.replace(".", os.sep))
164-
.with_suffix(".py").resolve()
164+
.with_suffix(".py")
165+
.resolve()
165166
.relative_to(self.tests_root)
166167
)
167168
if (
@@ -184,7 +185,8 @@ def leave_SimpleStatementLine(
184185
)
185186
rel_path = (
186187
Path(invocation_id.test_module_path.replace(".", os.sep))
187-
.with_suffix(".py").resolve()
188+
.with_suffix(".py")
189+
.resolve()
188190
.relative_to(self.tests_root)
189191
)
190192
if (
@@ -238,7 +240,6 @@ def add_runtime_comments_to_generated_tests(
238240
) -> GeneratedTestsList:
239241
"""Add runtime performance comments to function calls in generated tests."""
240242
tests_root = test_cfg.tests_root
241-
module_root = test_cfg.project_root_path
242243

243244
# Process each generated test
244245
modified_tests = []

codeflash/result/create_pr.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def existing_tests_source_for(
4242
rows = []
4343
headers = ["Test File::Test Function", "Original ⏱️", "Optimized ⏱️", "Speedup"]
4444
tests_root = test_cfg.tests_root
45-
module_root = test_cfg.project_root_path
4645
original_tests_to_runtimes: dict[Path, dict[str, int]] = {}
4746
optimized_tests_to_runtimes: dict[Path, dict[str, int]] = {}
4847
non_generated_tests = set()
@@ -52,7 +51,10 @@ def existing_tests_source_for(
5251
all_invocation_ids = original_runtimes_all.keys() | optimized_runtimes_all.keys()
5352
for invocation_id in all_invocation_ids:
5453
rel_path = (
55-
Path(invocation_id.test_module_path.replace(".", os.sep)).with_suffix(".py").resolve().relative_to(tests_root)
54+
Path(invocation_id.test_module_path.replace(".", os.sep))
55+
.with_suffix(".py")
56+
.resolve()
57+
.relative_to(tests_root)
5658
)
5759
if rel_path not in non_generated_tests:
5860
continue

codeflash/telemetry/posthog_cf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def initialize_posthog(enabled: bool = True) -> None: # noqa: FBT001, FBT002
2121
return
2222

2323
global _posthog # noqa: PLW0603
24-
_posthog = Posthog(project_api_key="phc_aUO790jHd7z1SXwsYCz8dRApxueplZlZWeDSpKc5hol", host="https://us.posthog.com")
24+
_posthog = Posthog(project_api_key="phc_aUO790jHd7z1SXwsYCz8dRApxueplZlZWeDSpKc5hol", host="https://us.posthog.com") # type: ignore[no-untyped-call]
2525
_posthog.log.setLevel(logging.CRITICAL) # Suppress PostHog logging
2626
ph("cli-telemetry-enabled")
2727

@@ -41,6 +41,6 @@ def ph(event: str, properties: dict[str, Any] | None = None) -> None:
4141
user_id = get_user_id()
4242

4343
if user_id:
44-
_posthog.capture(distinct_id=user_id, event=event, properties=properties)
44+
_posthog.capture(distinct_id=user_id, event=event, properties=properties) # type: ignore[no-untyped-call]
4545
else:
4646
logger.debug("Failed to log event to PostHog: User ID could not be retrieved.")

0 commit comments

Comments
 (0)