@ikunin/sprintpilot 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -57,6 +57,12 @@ function escapeRe(s) {
|
|
|
57
57
|
// Extract a story's status from sprint-status.yaml without pulling in a
|
|
58
58
|
// full YAML parser. Supports both inline form (`<key>: <status>`) and
|
|
59
59
|
// block form (`<key>:\n status: <status>\n title: ...`).
|
|
60
|
+
//
|
|
61
|
+
// Tolerates trailing `# comment` on inline status lines — the BMad
|
|
62
|
+
// convention is `<key>: done # PR #N merged ...` and the previous
|
|
63
|
+
// regex required `\s*$` immediately after the status token, rejecting
|
|
64
|
+
// every commented entry. The block-form inner status regex never
|
|
65
|
+
// anchored to end-of-line, so it always tolerated comments.
|
|
60
66
|
function storyStatusFromSprintStatus(text, storyKey) {
|
|
61
67
|
if (!text || !storyKey) return null;
|
|
62
68
|
const k = escapeRe(storyKey);
|
|
@@ -69,7 +75,12 @@ function storyStatusFromSprintStatus(text, storyKey) {
|
|
|
69
75
|
if (sm) return sm[1];
|
|
70
76
|
}
|
|
71
77
|
// Inline form: ` story-key: done` (status as scalar value).
|
|
72
|
-
|
|
78
|
+
// Optional trailing `# comment` is allowed so `done # PR #N merged`
|
|
79
|
+
// matches `done` instead of failing the whole line.
|
|
80
|
+
const inlineRe = new RegExp(
|
|
81
|
+
`^\\s+${k}:\\s*["']?([\\w-]+)["']?\\s*(?:#.*)?$`,
|
|
82
|
+
'm',
|
|
83
|
+
);
|
|
73
84
|
const im = text.match(inlineRe);
|
|
74
85
|
return im ? im[1] : null;
|
|
75
86
|
}
|
package/package.json
CHANGED