From a45ec10b7ae86c05a56e8f7ad89ed018f46e2989 Mon Sep 17 00:00:00 2001 From: Alexander Whitestone Date: Tue, 21 Apr 2026 11:23:59 +0000 Subject: [PATCH] fix(#211): Fix two SyntaxErrors in perf_bottleneck_finder.py - Line 116: Fixed quote escaping in open() regex pattern - Lines 509-510: Fixed split string literal in return statement - Verified: python3 -m py_compile succeeds --- scripts/perf_bottleneck_finder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/perf_bottleneck_finder.py b/scripts/perf_bottleneck_finder.py index 82db21a..89631e6 100644 --- a/scripts/perf_bottleneck_finder.py +++ b/scripts/perf_bottleneck_finder.py @@ -113,7 +113,7 @@ def find_slow_tests_by_scan(repo_path: str) -> List[Bottleneck]: (r"time\.sleep\((\d+(?:\.\d+)?)\)", "Contains time.sleep() — consider using mock or async wait"), (r"subprocess\.run\(.*timeout=(\d+)", "Subprocess with timeout — may block test"), (r"requests\.(get|post|put|delete)\(", "Real HTTP call — mock with responses or httpretty"), - (r"open\([^)]*['\"]w['\"]", "File I/O in test - use tmp_path fixture"), + (r"open\\([^)]*['\"]w['\"]", "File I/O in test - use tmp_path fixture"), ] for root, dirs, files in os.walk(repo_path): @@ -506,8 +506,8 @@ def format_markdown(report: PerfReport) -> str: lines.append(f"- {icon} {b.name}{loc} — ~{b.duration_s:.1f}s — {b.recommendation}") lines.append(f"") - return " -".join(lines) + return "\n".join(lines) + # ── Main ───────────────────────────────────────────────────────────