From f2ea12fcfff0f40ca2fd50c487ab0841e2cf484d Mon Sep 17 00:00:00 2001 From: luciferlive112116 <291889058+luciferlive112116@users.noreply.github.com> Date: Wed, 1 Jul 2026 14:00:26 +0800 Subject: [PATCH] fix(signals): match hyphenated test-only no-issue rationale Co-authored-by: Cursor --- src/signals/engine.ts | 4 +++- test/unit/signals-v2.test.ts | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/signals/engine.ts b/src/signals/engine.ts index 3bf07d5587..748a5afb19 100644 --- a/src/signals/engine.ts +++ b/src/signals/engine.ts @@ -4958,7 +4958,9 @@ export function hasClearNoIssueRationale(pr: Pick { }); }); +describe("hasClearNoIssueRationale test-only spelling", () => { + it("recognizes hyphenated and spaced test-only rationales", () => { + expect(hasClearNoIssueRationale({ title: "test only: lock regression", body: "" })).toBe(true); + expect(hasClearNoIssueRationale({ title: "test-only: lock regression", body: "" })).toBe(true); + expect(hasClearNoIssueRationale({ title: "tests-only coverage", body: "" })).toBe(true); + expect(hasClearNoIssueRationale({ title: "Add branch classifier", body: "This is a tests only change." })).toBe(true); + }); + + it("still rejects unrelated PR text that mentions tests without a rationale", () => { + expect(hasClearNoIssueRationale({ title: "Add tests for classifier", body: "Adds coverage." })).toBe(false); + expect(hasClearNoIssueRationale({ title: "Improve test harness", body: "" })).toBe(false); + }); +}); + function snapshot( id: string, repositories: Array<{