From 10f51a4949f52ae63157b05af02e9ab8929d09ae Mon Sep 17 00:00:00 2001 From: Voyagerroc-Pro <330935573+Voyagerroc-Pro@users.noreply.github.com> Date: Sat, 19 Sep 2026 18:58:23 +0300 Subject: [PATCH] fix(drift): ignore version-shaped path references --- src/drift/__tests__/path-false-positives.test.ts | 5 +---- src/drift/checkers/path.ts | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/drift/__tests__/path-false-positives.test.ts b/src/drift/__tests__/path-false-positives.test.ts index 6dd8713d..81a53b8e 100644 --- a/src/drift/__tests__/path-false-positives.test.ts +++ b/src/drift/__tests__/path-false-positives.test.ts @@ -60,10 +60,7 @@ describe("MISSING_PATH false positives", () => { ).toEqual([]); }); - // Not part of #143. A trailing version number reads as a file extension to - // the guard above, so `release/2.1.0` never reaches the unrooted check and is - // reported as a missing path. Tracked separately; unskip with the fix. - it.skip("does not claim a version-shaped branch name", () => { + it("does not claim version-shaped branch and runtime references (#201)", () => { expect( missingPaths("# Release\n\n- Work landed on `release/2.1.0` and `python/3.11`\n") ).toEqual([]); diff --git a/src/drift/checkers/path.ts b/src/drift/checkers/path.ts index 1d862daf..9a0ef531 100644 --- a/src/drift/checkers/path.ts +++ b/src/drift/checkers/path.ts @@ -94,7 +94,7 @@ function isUnrootedReference( const trimmed = value.replace(/\/+$/, ""); const isDirectoryRef = trimmed !== value; if (!trimmed.includes("/") && !isDirectoryRef) return false; - if (/\.[A-Za-z0-9]+$/.test(trimmed)) return false; + if (/\.[A-Za-z][A-Za-z0-9]*$/.test(trimmed)) return false; const first = trimmed.split("/")[0]; if (!first || first.startsWith("@") || first === "." || first === "..") return false;