Skip to content

Commit 70458cd

Browse files
committed
Restore the docstring the guard suite's docstring gate requires
Earlier editing of the guard suite dropped the docstring on stepIndex, and the constant holding the workflow source was never documented. Packages that gate on 100% docstring coverage fail on both. Caught by pm-presets, whose gate runs over its test tree, and fixed everywhere for consistency. Tracked as pm-github-yq1d.
1 parent 8f8d83e commit 70458cd

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎test/release-workflow.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@ import { readFileSync } from "node:fs";
33
import { resolve } from "node:path";
44
import test from "node:test";
55

6+
/** The release workflow source, read once and asserted against as text. */
67
const workflow = readFileSync(
78
resolve(import.meta.dirname, "../.github/workflows/release.yml"),
89
"utf-8"
910
);
1011

12+
/**
13+
* Locate a named workflow step so tests can assert on ordering between steps.
14+
*
15+
* Offsets are taken against the raw source rather than a comment-stripped copy:
16+
* removing text shifts every index after it, which would silently corrupt the
17+
* ordering comparisons these offsets exist to support.
18+
*
19+
* @param name - The exact `- name:` value of the step.
20+
* @returns The character offset of that step within the workflow source.
21+
*/
1122
function stepIndex(name: string): number {
1223
const escapedName = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1324
const match = new RegExp(

0 commit comments

Comments
 (0)