Skip to content

semver: collapse a || union containing a match-all branch to * before the prerelease rule - #33739

Open
robobun wants to merge 12 commits into
mainfrom
farm/2e7244b8/semver-any-collapse
Open

semver: collapse a || union containing a match-all branch to * before the prerelease rule#33739
robobun wants to merge 12 commits into
mainfrom
farm/2e7244b8/semver-any-collapse

semver: treat a bare '-' branch as non-ANY; compare MATCH_ALL_BRANCH …

a355a12
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 8, 2026 in 32m 8s

Code review found 3 potential issues

Found 1 candidates, confirmed 3. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 3
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/semver/SemverQuery.rs:943-947 Lone '|' (single pipe) misclassified as '||' separator, sets MATCH_ALL_BRANCH

Annotations

Check warning on line 947 in src/semver/SemverQuery.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Lone '|' (single pipe) misclassified as '||' separator, sets MATCH_ALL_BRANCH

Same class as the `boop`/`^`/`-` siblings, but at the separator itself: the `b'|'` arm doesn't distinguish a lone `|` from `||` (the inner `while input[i] == b'|'` runs zero times), so `"| 1.2.3-alpha.1"` sets `MATCH_ALL_BRANCH` at line 944 and `Bun.semver.satisfies("1.2.3-alpha.1", "| 1.2.3-alpha.1")` now returns `false` — pre-PR Bun and npm-loose (which only splits on `/\s*\|\|\s*/` and drops a lone `|` via `COMPARATORLOOSE`) return `true`. Trailing form `"1.2.3-alpha.1 |"` hits the same via t