* fix(#2203): traceability parser matches REQ-IDs in any column, not just the first The traceability table-row parser required the REQ-ID in the first column (`^| REQ-ID |`). A table that leads with a status column (e.g. `| ☐ | REQ-01 |`) matched zero rows, so phase complete warned every body REQ-ID was missing. Match REQ-IDs in any pipe-delimited cell (drop the ^ anchor). Closes #2203 * docs(#2203): add changeset fragment * docs(#2203): backfill PR number
This commit is contained in:
5
.changeset/noble-wasps-greet.md
Normal file
5
.changeset/noble-wasps-greet.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
type: Fixed
|
||||
pr: 2234
|
||||
---
|
||||
**`phase complete` no longer false-reports REQ-IDs as missing when the traceability table leads with a status column** — the parser required the REQ-ID in the first column, so a table shaped `| ☐ | REQ-01 | …` matched zero rows and every body REQ-ID was reported missing. It now matches REQ-IDs in any column. (#2203)
|
||||
@@ -1672,7 +1672,11 @@ function cmdPhaseComplete(cwd: string, phaseNum: string, raw: boolean): void {
|
||||
? reqContent.slice(traceabilityHeadingMatch.index)
|
||||
: '';
|
||||
const tableReqIds = new Set<string>();
|
||||
const tableRowPat = /^\|\s*([A-Z][A-Z0-9]*-\d+)\s*\|/gm;
|
||||
// #2203: match REQ-IDs in any pipe-delimited cell (not just the first
|
||||
// column) so a traceability table that leads with a status column (e.g.
|
||||
// | ☐ | REQ-01 | …) is parsed correctly instead of reporting every row
|
||||
// as missing.
|
||||
const tableRowPat = /\|\s*([A-Z][A-Z0-9]*-\d+)\s*\|/g;
|
||||
let tableMatch: RegExpExecArray | null;
|
||||
while ((tableMatch = tableRowPat.exec(traceabilitySection)) !== null) {
|
||||
tableReqIds.add(tableMatch[1]);
|
||||
|
||||
Reference in New Issue
Block a user