semver: collapse a || union containing a match-all branch to * before the prerelease rule - #33739
Open
robobun wants to merge 12 commits into
Open
semver: collapse a || union containing a match-all branch to * before the prerelease rule#33739robobun wants to merge 12 commits into
robobun wants to merge 12 commits into
Claude / Claude Code Review
completed
Jul 8, 2026 in 32m 45s
Code review found 2 potential issues
Found 1 candidates, confirmed 2. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 0 |
| 🟡 Nit | 2 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🟡 Nit | src/semver/SemverQuery.rs:934-954 |
Three consecutive pipes ('|||') set MATCH_ALL_BRANCH; regression from pre-PR Bun and npm-loose |
Annotations
Check warning on line 954 in src/semver/SemverQuery.rs
claude / Claude Code Review
Three consecutive pipes ('|||') set MATCH_ALL_BRANCH; regression from pre-PR Bun and npm-loose
Gap in the b7412e5f lone-`|` fix: `is_double` only checks the byte immediately after the first `|`, then the `while` consumes the whole pipe run as one separator — so for exactly three trailing pipes (`"1.2.3-alpha.1 |||"`), `is_double` is true, all 3 are swallowed, the new branch is empty, and the post-loop check sets `MATCH_ALL_BRANCH` (Bun → `false`). npm-loose splits on `/\s*\|\|\s*/` giving `["1.2.3-alpha.1", "|"]`; the lone-`|` branch is dropped via `.filter(c => c.length)` **before** the
Loading