benchmark
5d2e9719 - Remove unused variable ver_regex parameter usage at...

Commit
32 days ago
Remove unused variable ver_regex parameter usage at... Summary: Remove unused variable `ver_regex` parameter usage at regression_detector.py:150-154 where the regex pattern could be inlined into the re.search() call since it's only used once Addresses claude_idea in `pytorch/benchmark`. Files modified: `fbcode/pytorch/benchmark/regression_detector.py` Better Engineering: Dead code removal — reduces code complexity and maintenance burden for future authors of this file. AI Review: - security: PASSED (1.00) — 2. Inlining `ver_regex` into `re.search()` with a raw string prefix (lines 150-151) — no behavioral change; the regex pattern is a static string literal, not user-controlled, so no injection risk. 3. Removing unnecessary `f` prefix from strings without interpolation (lines 370, 378) — cosmetic. 4. Converting lambdas to named `def` functions (lines 380-381, 400-401) — cosmetic, no security impact. 5. Line-wrapping long f-strings — cosmetic. None of these changes introduce secrets, injection vectors, auth bypasses, path traversal, or sensitive data exposure. - quality: PASSED (0.95) — 2. **Inlining `ver_regex`** (lines 150-151): The `r""` raw string prefix is added, but the behavior is identical — `\+` is not a recognized Python escape sequence, so `"dev[0-9+]\+"` and `r"dev[0-9+]\+"` produce the same regex pattern. No behavior change. 3. **f-string → plain string** (lines 370, 378): Correct — no interpolation needed. 4. **Lambda → def** (lines 380-381, 400-401): Correct refactoring. 5. **Long line wrapping** (various): Purely cosmetic, no behavior change. No issues found in the changed code. The regex has no capturing groups, which means `s.groups()` on the unchanged line 153 would always be empty — but that's a **pre-existing bug** in unchanged code, not introduced by this diff. - task_solution: PASSED (0.70) — [INFORMATION] in fbcode/pytorch/benchmark/regression_detector.py:84: The change from `except:` to `except Exception:`, lambda-to-def conversions, f-string prefix removals, and line-length reformatting are all unrelated to the stated task of inlining `ver_regex`. While individually harmless, they make the diff broader than necessary and could complicate review. Reviewed By: xuzhao9 Differential Revision: D97060662 fbshipit-source-id: 5ec52a5b379ceef6565556b75dbeb5ea8a7ea033
Author
Sameer Khanna
Committer
Parents
Loading