@mark1russell7/conventions 0.33.0 → 0.34.0
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.
- package/README.md +1 -0
- package/build/cli.js +1 -1
- package/build/index.d.ts +12 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/{run--5zk2wDX.js → run-Bn3XU7rh.js} +69 -2
- package/build/run-Bn3XU7rh.js.map +1 -0
- package/package.json +5 -2
- package/build/run--5zk2wDX.js.map +0 -1
package/README.md
CHANGED
|
@@ -59,6 +59,7 @@ The rules come from the invariants audit of 2026-10-26 (strategy item s38). The
|
|
|
59
59
|
| `main-check` | No script finds out that it is the main module by a compare of `process.argv[1]` with its own path. Through a link (for example `~/git` to `D:/git`), the two paths differ: the script does nothing, and it ends with exit code 0. A script uses `import.meta.main`, or `realpathSync` on each side. | private `main-check` (STRATEGY.md, 2026-11-02). |
|
|
60
60
|
| `tests-required` | No test runner passes when it finds no test: no `passWithNoTests: true` in a config of vitest, vite, jest or Playwright, and no `--passWithNoTests` in `package.json`. With the option, a broken include pattern turns the test gate green with no test run. | private `fail-closed` (STRATEGY.md, 2026-10-30). |
|
|
61
61
|
| `roadmap-parses` | Each call of the Pages workflow of the template (`reusable-pages.yml`) gives a `roadmap`, or `site-pages: false`. Without it, the Status page shows no item of the plan. Each roadmap that a workflow gives to the Status page (a `roadmap:` key) parses as `@mark1russell7/site-pages` reads it. The rule uses the parser of site-pages. Thus a pull request finds a bad row, and the Pages job on `main` does not stop on it. | private `fail-closed` (STRATEGY.md, 2026-10-30). |
|
|
62
|
+
| `workflow-parses` | Each workflow of `.github/workflows` and each file `action.yml` of `.github/actions` parses as YAML, with the parser of the package `yaml`. GitHub refuses a workflow that does not parse, and starts no job. A workflow that starts only on a schedule, a dispatch or `workflow_run` does not start on its pull request. So the rule finds its fault before the merge. The break names the first fault of each file. | layout-contract `memory-probe.yml`, run 42172612147 (2026-11-06). |
|
|
62
63
|
| `runner-budget` | All repositories of the account share 40 runners. Each `strategy` with a `matrix` has a `max-parallel` of 3 or less. Each workflow has a concurrency group at the top or in each job. A job that calls a shared workflow of the option `grouped` gets its group from that workflow, and each job of that workflow has a group. The minute of each `cron` comes from a hash of the repository and the file (1 to 59), so the schedules of the repositories do not start together. The repository comes from `GITHUB_REPOSITORY` or from the remote `origin`. | private `runner-slots` (STRATEGY.md, 2026-10-30). |
|
|
63
64
|
| `main-runs-finish` | A workflow that starts on `push` or on `workflow_call` does not cancel a run in progress. A called workflow gets the event of its caller. A newer push cancels only the run of a pull request: `cancel-in-progress: ${{ github.event_name == 'pull_request' }}`. Each commit of `main` has its own concurrency group: `${{ github.event_name == 'pull_request' && github.ref || github.sha }}`. In one group, GitHub cancels a run that waits when a newer run comes, whatever `cancel-in-progress` says. On 2026-11-03 four waiting CI runs of `main` in client were cancelled, so its version commit had no result and no release. On 2026-11-03 the next merge cancelled the CI run of a commit on `main`, so the main check of that commit had no result. A bench run on `main` was cancelled too, and its claim had no measurement. | private `main-runs-finish` (STRATEGY.md, 2026-11-03). |
|
|
64
65
|
| `push-main-only` | A workflow that starts on `push` and on `pull_request` limits `push` to the default branch with `branches`, and has `workflow_dispatch`. Without the limit, each commit of a pull request starts two runs. A `push` with only a tag filter, a `pull_request` with `types` that do not have `synchronize`, and `pull_request_target` are not breaks. `CI.md` tells each case in "One run for each commit". |
|
package/build/cli.js
CHANGED
package/build/index.d.ts
CHANGED
|
@@ -382,6 +382,17 @@ export declare const TRAIN_SCOPES: readonly ["@mark1russell7/*", "@procedures/*"
|
|
|
382
382
|
/** 7 days, in minutes. */
|
|
383
383
|
export declare const IGNORE_AFTER = 10080;
|
|
384
384
|
export declare const trustPolicy: Rule;
|
|
385
|
+
/** A file that GitHub reads as YAML: a workflow, or the file `action.yml` of an action of the repository. */
|
|
386
|
+
export declare const GITHUB_YAML: RegExp;
|
|
387
|
+
/** A fault of the YAML of a file: its line and column (from 1), and the first line of the message of the parser. */
|
|
388
|
+
interface YamlFault {
|
|
389
|
+
readonly line: number;
|
|
390
|
+
readonly column: number;
|
|
391
|
+
readonly message: string;
|
|
392
|
+
}
|
|
393
|
+
/** This function gives the faults of a YAML text. A text with no fault gives an empty list. */
|
|
394
|
+
export declare function yamlFaults(text: string): YamlFault[];
|
|
395
|
+
export declare const workflowParses: Rule;
|
|
385
396
|
export declare const workspaceProtocol: Rule;
|
|
386
397
|
/** Each rule of the check. */
|
|
387
398
|
export declare const RULES: readonly Rule[];
|
|
@@ -547,5 +558,5 @@ export declare function workspaceGlobs(root: string): string[] | undefined;
|
|
|
547
558
|
* The result has absolute paths, in the order of the code units.
|
|
548
559
|
*/
|
|
549
560
|
export declare function packageFolders(root: string, globs?: readonly string[] | undefined): string[];
|
|
550
|
-
export type { AuditSource, Break, CheckOptions, CheckResult, CliIo, ConventionsConfig, Edit, FixResult, Home, HomeAnswer, HomeFetch, HomeState, Manifest, Minor, OptionSpec, OptionValue, Options, PackageInfo, PagesCall, PathFilter, RegistryAnswer, RegistryLookup, Rule, RuleConfig, RuleContext, RuleOutcome, RuleResult, Workflow, WorkflowInput, WorkflowJob, WorkflowStep };
|
|
561
|
+
export type { AuditSource, Break, CheckOptions, CheckResult, CliIo, ConventionsConfig, Edit, FixResult, Home, HomeAnswer, HomeFetch, HomeState, Manifest, Minor, OptionSpec, OptionValue, Options, PackageInfo, PagesCall, PathFilter, RegistryAnswer, RegistryLookup, Rule, RuleConfig, RuleContext, RuleOutcome, RuleResult, Workflow, WorkflowInput, WorkflowJob, WorkflowStep, YamlFault };
|
|
551
562
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/rule.ts","../src/config.ts","../src/rules/cue-preset.ts","../src/rules/gate-after-cancel.ts","../src/rules/gate-trigger.ts","../src/map.ts","../src/rules/home-package.ts","../src/rules/license-file.ts","../src/rules/main-check.ts","../src/rules/no-build-output.ts","../src/rules/no-local-paths.ts","../src/rules/api-report-script.ts","../src/rules/pages-after-release.ts","../src/rules/pages-site.ts","../src/rules/pinned-git-deps.ts","../src/rules/pipe-fails.ts","../src/rules/push-main-only.ts","../src/rules/unreleased-change.ts","../src/rules/published-minor.ts","../src/rules/release-files.ts","../src/rules/required-scripts.ts","../src/rules/roadmap-parses.ts","../src/rules/runner-budget.ts","../src/rules/shared-docs.ts","../src/rules/source-main.ts","../src/rules/tests-required.ts","../src/rules/tsconfig-test.ts","../src/rules/typed-files.ts","../src/rules/typed-scripts.ts","../src/rules/trust-policy.ts","../src/rules/workspace-protocol.ts","../src/rules/index.ts","../src/home-exports.ts","../src/workflow.ts","../src/run.ts","../src/release-text.ts","../src/workspace.ts"],"mappings":";UASiB;WACN;WACA;WACA;;;UAIM;;WAEN;;WAEA;WACA;;WAEA;;WAEA,iBAAiB;;;;;;UAOX;;WAEN;;WAEA;;WAEA;;;wBAIK,YAAY,cAAc,cAAc;;KAQ5C;;KAGA,UAAU,SAAS,eAAe;;UAG7B;WACN;WACA,SAAS;WACT;;;KAIC,WAAW,SAAS;;UAGf;;WAEN;;WAEA;;WAEA;;WAEA;WACA,UAAU;;;UAIJ;;WAEN;;WAEA,aAAa;;WAEb,mBAAmB;;WAEnB,KAAK,SAAS;;WAEd;;EAET;;EAEA,IAAI;;;KAIM,uBAAuB;WAAqB;;;UAGvC;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,kBAAkB;;WAElB,SAAS,SAAS,eAAe;;;;;WAKjC;EACT,MAAM,SAAS,aAAa,SAAS,UAAU;;;qBAIpC;;wBAGG,aAAa,UAAU,UAAU;;wBAOjC,OAAO,cAAc,gBAAgB;;wBAOrC,QAAQ,cAAc,eAAe;;qBAMxC,WAAY,gBAAgB;;qBAG5B,YAAa;;wBAGV,WAAW,cAAc;;;;;;wBASzB,WAAW;;wBA2BX,UAAU;;wBAUV,OAAO,cAAc;;qBAOxB,UAAW,aAAa;;;;;wBAMrB,aAAa,SAAS,K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kC;;WAA+B;;;KAGpJ,kBAAkB,0BAA0B,qBAAqB,oBAAoB;;qBAGpF;;qBAGA;;qBAkBA;;;;;qBAyBA,WAAW;;wBAmGR,qBAAqB,SAAQ,iBAA6B;qBA4G7D,kBAAkB;;KCrQnB,kBAAkB,eAAe;;wBAG7B,QAAQ,kBAAkB;;;;;;wBAY1B,QAAQ,oBAAoB;;;;;wBAuB5B,eAAe,eAAe,oBAAoB;;wBA0ClD,mBAAmB,SAAQ,gBAA4B,qBAA+B;qBA8DzF,gBAAgB;qBCxHhB,cAAc;qBCTd,iBAAiB;;wBCqCd,cAAc;qBAajB,eAAe;;;;;;wBC1DZ,eAAe,oBAAoB;;wBAUnC,mBAAmB;qBAoJtB,cAAc;;KClKf;WAAwB;;WAA4B;;;KAGpD,aAAa,4BAA4B,oBAAoB;;qBAG5D;;qBAiBA,aAAa;;qBAcb,YAAa;;wBAoEV,eAAe,aAAY,YAA0B;;wBC3GrD,QAAQ;;wBAQR,aAAa;qBAKhB,YAAY;qBCkBZ,eAAe;;wBCpBZ,SAAS,0BAA0B;qBAKtC,cAAc;;wBCmDX,gBAAgB;;;;;wBAmChB,UACd,SAAS,SAAS,0BAClB,cACA,OAAM;qBAkRK,YAAY;qBC/VZ,cAAc;;qBC3Bd;;qBAGA;qBA6DA,aAAa;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/rule.ts","../src/config.ts","../src/rules/cue-preset.ts","../src/rules/gate-after-cancel.ts","../src/rules/gate-trigger.ts","../src/map.ts","../src/rules/home-package.ts","../src/rules/license-file.ts","../src/rules/main-check.ts","../src/rules/no-build-output.ts","../src/rules/no-local-paths.ts","../src/rules/api-report-script.ts","../src/rules/pages-after-release.ts","../src/rules/pages-site.ts","../src/rules/pinned-git-deps.ts","../src/rules/pipe-fails.ts","../src/rules/push-main-only.ts","../src/rules/unreleased-change.ts","../src/rules/published-minor.ts","../src/rules/release-files.ts","../src/rules/required-scripts.ts","../src/rules/roadmap-parses.ts","../src/rules/runner-budget.ts","../src/rules/shared-docs.ts","../src/rules/source-main.ts","../src/rules/tests-required.ts","../src/rules/tsconfig-test.ts","../src/rules/typed-files.ts","../src/rules/typed-scripts.ts","../src/rules/trust-policy.ts","../src/rules/workflow-parses.ts","../src/rules/workspace-protocol.ts","../src/rules/index.ts","../src/home-exports.ts","../src/workflow.ts","../src/run.ts","../src/release-text.ts","../src/workspace.ts"],"mappings":";UASiB;WACN;WACA;WACA;;;UAIM;;WAEN;;WAEA;WACA;;WAEA;;WAEA,iBAAiB;;;;;;UAOX;;WAEN;;WAEA;;WAEA;;;wBAIK,YAAY,cAAc,cAAc;;KAQ5C;;KAGA,UAAU,SAAS,eAAe;;UAG7B;WACN;WACA,SAAS;WACT;;;KAIC,WAAW,SAAS;;UAGf;;WAEN;;WAEA;;WAEA;;WAEA;WACA,UAAU;;;UAIJ;;WAEN;;WAEA,aAAa;;WAEb,mBAAmB;;WAEnB,KAAK,SAAS;;WAEd;;EAET;;EAEA,IAAI;;;KAIM,uBAAuB;WAAqB;;;UAGvC;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,kBAAkB;;WAElB,SAAS,SAAS,eAAe;;;;;WAKjC;EACT,MAAM,SAAS,aAAa,SAAS,UAAU;;;qBAIpC;;wBAGG,aAAa,UAAU,UAAU;;wBAOjC,OAAO,cAAc,gBAAgB;;wBAOrC,QAAQ,cAAc,eAAe;;qBAMxC,WAAY,gBAAgB;;qBAG5B,YAAa;;wBAGV,WAAW,cAAc;;;;;;wBASzB,WAAW;;wBA2BX,UAAU;;wBAUV,OAAO,cAAc;;qBAOxB,UAAW,aAAa;;;;;wBAMrB,aAAa,SAAS,KAAK,oDAAoD;;UC1M9E;;WAEN;;WAEA;;WAEA;;WAEA,SAAS;;;UAIH;;WAEN;;WAEA,OAAO,SAAS,eAAe;;;wBAW1B,eAAe,MAAM,OAAO;;;;;;;wBAU5B,YAAY,gBAAgB,gBAAgB,SAAS;;qBCnCxD;qBA4FA,WAAW;qBC5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;WAEN;;WAEA;;WAEA,QAAQ;;;;;;;wBAWH,OAAO,SAAS,eAAe;;wBAyC/B,aAAa,QAAQ;;wBA0BrB,gBAAgB,QAAQ;;wBAsBxB,YAAY,QAAQ;;wBAYpB,UAAU,QAAQ,+BAA+B,iBAAgB;;UAkBhE;WACN;WACA,KAAK,SAAS;WACd,SAAS;WACT,SAAS;;;qBAIP;;wBA6CG,OAAO,yBAAyB,IAAI;;;;;;;;qBChUvC;;wBAGG,QAAQ,cAAc,iBAAiB;;;;;;;;wBAavC,iBAAiB,kBAAkB,iBAAiB;;wBA+BpD,OAAO,cAAc;;;;;wBAQrB,aAAa,cAAc,iBAAiB;;;;;;wBCzC5C,aAAa,eAAe;;;;;wBAsD5B,YAAY,cAAc;;;;;;wBA8B1B,eAAe;;;;;;;wBAwCf,eAAe,cAAc"}
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as repositoryOfRemote, $t as runGit, A as blockHash, At as mergeHomes, B as publishedMinorRule, Bt as STRICT_OPTIONS, C as testsRequired, Ct as repoOf, D as pathsOf, Dt as findHomes, E as isSourcePath, Et as MAP_RULE, F as requiredScripts, Ft as gateTrigger, G as npmLookup, Gt as hasFile, H as NPM_REGISTRY, Ht as DEPENDENCY_FIELDS, I as releaseFiles, It as prPathFilters, J as pipeFails, Jt as lineOf, K as unreleasedChange, Kt as inFolder, L as lockedVersions, Lt as summaryName, M as sharedDocsRule, Mt as HOME_EXPORTS, N as roadmapOfLine, Nt as ACTIONS_COMMIT, O as sourceMain, Ot as mapMarkdown, P as roadmapParses, Pt as convertGate, Q as pagesAfterRelease, Qt as replaceLine, R as minorOf, Rt as gateAfterCancel, S as typedFiles, St as messageOf, T as tsconfigTest, Tt as HOMES, U as SHIPPED_FIELDS, Ut as cleanPath, V as reachOf, Vt as cuePreset, W as UNSHIPPED_FILES, Wt as codePackages, X as isPinned, Xt as parseJsonc, Y as isGitSpecifier, Yt as matchesAny, Z as pinnedGitDeps, Zt as readJsonc, _ as TRAIN_SCOPES, _t as licenseFileOf, a as listRules, an as defaultOptions, at as pagesSite, b as configsOfScript, bt as declaredName, c as runCli, ct as HOME_PATTERNS, d as RULES, dt as REAL_COMPARE, en as specifiersOf, et as runnerBudget, f as workspaceProtocol, ft as hasImportMetaMain, g as IGNORE_AFTER, gt as licenseFile, h as yamlFaults, ht as authorOf, i as formatResult, in as workspaceGlobs, it as pagesCalls, j as githubFetch, jt as readOverlay, k as HOME_TIMEOUT_MS, kt as mapText, l as runFix, lt as noLocalPaths, m as workflowParses, mt as LICENSE_TEXTS, n as annotations, nn as globToRegExp, nt as pushMainOnly, o as readConfig, on as parseConfig, ot as apiReportScript, p as GITHUB_YAML, pt as mainCheck, q as unreleasedChangeRule, qt as keyLine, r as createContext, rn as packageFolders, rt as PAGES_WORKFLOWS, s as runChecks, st as DEFAULT_ALLOWED, t as USAGE, tn as globFolders, tt as scheduleMinute, u as summaryMarkdown, ut as noBuildOutput, v as trustPolicy, vt as mitText, w as hasTests, wt as signaturesOf, x as scriptsOf, xt as homePackage, y as typedScripts, yt as repositoryIsPublic, z as publishedMinor, zt as readWorkflow } from "./run-Bn3XU7rh.js";
|
|
2
2
|
// src/release-text.ts
|
|
3
3
|
/**
|
|
4
4
|
* The rule for the git tag and the text of a GitHub release of a package version.
|
|
@@ -64,6 +64,6 @@ function releaseNotes(name, version, changelog) {
|
|
|
64
64
|
if (section.length <= 1e5) return section;
|
|
65
65
|
return `${section.slice(0, MAX_NOTES)}\n\n(The CHANGELOG.md of \`${name}\` has the full text.)`;
|
|
66
66
|
}
|
|
67
|
-
export { ACTIONS_COMMIT, DEFAULT_ALLOWED, DEPENDENCY_FIELDS, HOMES, HOME_EXPORTS, HOME_PATTERNS, HOME_TIMEOUT_MS, IGNORE_AFTER, LICENSE_TEXTS, MAP_RULE, MAX_NOTES, NPM_REGISTRY, PAGES_WORKFLOWS, REAL_COMPARE, RULES, SHIPPED_FIELDS, STRICT_OPTIONS, TRAIN_SCOPES, UNSHIPPED_FILES, USAGE, annotations, apiReportScript, authorOf, blockHash, changelogSection, cleanPath, codePackages, configsOfScript, convertGate, createContext, cuePreset, declaredName, defaultOptions, findHomes, formatResult, gateAfterCancel, gateTrigger, githubFetch, globFolders, globToRegExp, hasFile, hasImportMetaMain, hasTests, homePackage, inFolder, isGitSpecifier, isPinned, isSourcePath, keyLine, licenseFile, licenseFileOf, lineOf, listRules, lockedVersions, mainCheck, mapMarkdown, mapText, matchesAny, mergeHomes, messageOf, minorOf, mitText, noBuildOutput, noLocalPaths, npmLookup, npmUrl, packageFolders, pagesAfterRelease, pagesCalls, pagesSite, parseConfig, parseJsonc, pathsOf, pinnedGitDeps, pipeFails, prPathFilters, publishedMinor, publishedMinorRule, pushMainOnly, reachOf, readConfig, readJsonc, readOverlay, readWorkflow, releaseFiles, releaseNotes, replaceLine, repoOf, repositoryIsPublic, repositoryOfRemote, requiredScripts, roadmapOfLine, roadmapParses, runChecks, runCli, runFix, runGit, runnerBudget, scheduleMinute, scriptsOf, sharedDocsRule, signaturesOf, sourceMain, specifiersOf, summaryMarkdown, summaryName, tagName, testsRequired, trustPolicy, tsconfigTest, typedFiles, typedScripts, unreleasedChange, unreleasedChangeRule, workspaceGlobs, workspaceProtocol };
|
|
67
|
+
export { ACTIONS_COMMIT, DEFAULT_ALLOWED, DEPENDENCY_FIELDS, GITHUB_YAML, HOMES, HOME_EXPORTS, HOME_PATTERNS, HOME_TIMEOUT_MS, IGNORE_AFTER, LICENSE_TEXTS, MAP_RULE, MAX_NOTES, NPM_REGISTRY, PAGES_WORKFLOWS, REAL_COMPARE, RULES, SHIPPED_FIELDS, STRICT_OPTIONS, TRAIN_SCOPES, UNSHIPPED_FILES, USAGE, annotations, apiReportScript, authorOf, blockHash, changelogSection, cleanPath, codePackages, configsOfScript, convertGate, createContext, cuePreset, declaredName, defaultOptions, findHomes, formatResult, gateAfterCancel, gateTrigger, githubFetch, globFolders, globToRegExp, hasFile, hasImportMetaMain, hasTests, homePackage, inFolder, isGitSpecifier, isPinned, isSourcePath, keyLine, licenseFile, licenseFileOf, lineOf, listRules, lockedVersions, mainCheck, mapMarkdown, mapText, matchesAny, mergeHomes, messageOf, minorOf, mitText, noBuildOutput, noLocalPaths, npmLookup, npmUrl, packageFolders, pagesAfterRelease, pagesCalls, pagesSite, parseConfig, parseJsonc, pathsOf, pinnedGitDeps, pipeFails, prPathFilters, publishedMinor, publishedMinorRule, pushMainOnly, reachOf, readConfig, readJsonc, readOverlay, readWorkflow, releaseFiles, releaseNotes, replaceLine, repoOf, repositoryIsPublic, repositoryOfRemote, requiredScripts, roadmapOfLine, roadmapParses, runChecks, runCli, runFix, runGit, runnerBudget, scheduleMinute, scriptsOf, sharedDocsRule, signaturesOf, sourceMain, specifiersOf, summaryMarkdown, summaryName, tagName, testsRequired, trustPolicy, tsconfigTest, typedFiles, typedScripts, unreleasedChange, unreleasedChangeRule, workflowParses, workspaceGlobs, workspaceProtocol, yamlFaults };
|
|
68
68
|
|
|
69
69
|
//# sourceMappingURL=index.js.map
|
|
@@ -3,6 +3,7 @@ import { spawnSync } from "node:child_process";
|
|
|
3
3
|
import { appendFileSync, existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { basename, dirname, extname, join, posix, relative, resolve, sep } from "node:path";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
|
+
import { parseAllDocuments } from "yaml";
|
|
6
7
|
// src/config.ts
|
|
7
8
|
/** The fields of the configuration of a rule that are not options. */
|
|
8
9
|
const RULE_FIELDS = [
|
|
@@ -12360,6 +12361,71 @@ const trustPolicy = {
|
|
|
12360
12361
|
return breaks;
|
|
12361
12362
|
}
|
|
12362
12363
|
};
|
|
12364
|
+
// src/rules/workflow-parses.ts
|
|
12365
|
+
/**
|
|
12366
|
+
* The rule `workflow-parses`: each workflow file and each action file of `.github` parses as YAML.
|
|
12367
|
+
*/
|
|
12368
|
+
/** A file that GitHub reads as YAML: a workflow, or the file `action.yml` of an action of the repository. */
|
|
12369
|
+
const GITHUB_YAML = /^\.github\/(?:workflows\/[^/]+|actions\/(?:[^/]+\/)*action)\.ya?ml$/;
|
|
12370
|
+
/** This function gives the faults of a YAML text. A text with no fault gives an empty list. */
|
|
12371
|
+
function yamlFaults(text) {
|
|
12372
|
+
const faults = [];
|
|
12373
|
+
for (const document of parseAllDocuments(text, { prettyErrors: true })) for (const error of document.errors) {
|
|
12374
|
+
const at = error.linePos?.[0];
|
|
12375
|
+
faults.push({
|
|
12376
|
+
line: at?.line ?? 1,
|
|
12377
|
+
column: at?.col ?? 1,
|
|
12378
|
+
message: (error.message.split("\n")[0] ?? error.code).replace(/:$/, "")
|
|
12379
|
+
});
|
|
12380
|
+
}
|
|
12381
|
+
return faults;
|
|
12382
|
+
}
|
|
12383
|
+
const workflowParses = {
|
|
12384
|
+
id: "workflow-parses",
|
|
12385
|
+
title: "Each workflow file and each file `action.yml` of `.github` parses as YAML.",
|
|
12386
|
+
reason: "GitHub refuses a workflow that does not parse, and starts no job. A workflow that starts only on a schedule, a dispatch or `workflow_run` does not start on its pull request, so no check finds the fault before the merge. On 2026-11-06 a line at column 1 ended a block `run: |`, and main went red.",
|
|
12387
|
+
fix: "Correct the YAML at the line of the break. A line of a block scalar (`run: |`) has the indent of the block, also a line of a string with quotes: write `\\n` in place of a real line break.",
|
|
12388
|
+
sources: [
|
|
12389
|
+
{
|
|
12390
|
+
repo: "layout-contract",
|
|
12391
|
+
rule: "memory-probe",
|
|
12392
|
+
doc: "run 42172612147 (2026-11-06): GitHub refused memory-probe.yml, and the run had no jobs"
|
|
12393
|
+
},
|
|
12394
|
+
{
|
|
12395
|
+
repo: "highways",
|
|
12396
|
+
rule: "predicate-dump",
|
|
12397
|
+
doc: "predicate-dump.yml starts only on a schedule and a dispatch, and the monthly census of algebra reads its dumps"
|
|
12398
|
+
},
|
|
12399
|
+
{
|
|
12400
|
+
repo: "algebra",
|
|
12401
|
+
rule: "study-monthly",
|
|
12402
|
+
doc: "study-monthly.yml starts only on a schedule and a dispatch, and refreshes the data of the site"
|
|
12403
|
+
}
|
|
12404
|
+
],
|
|
12405
|
+
options: {},
|
|
12406
|
+
check(context) {
|
|
12407
|
+
const files = context.gitFiles();
|
|
12408
|
+
if (files === void 0) return { skipped: "the root is not in a git repository" };
|
|
12409
|
+
const breaks = [];
|
|
12410
|
+
for (const file of files.filter((path) => GITHUB_YAML.test(path)).sort(byCode)) {
|
|
12411
|
+
let text;
|
|
12412
|
+
try {
|
|
12413
|
+
text = readFileSync(join(context.root, file), "utf8");
|
|
12414
|
+
} catch {
|
|
12415
|
+
continue;
|
|
12416
|
+
}
|
|
12417
|
+
const [first, ...more] = yamlFaults(text);
|
|
12418
|
+
if (first === void 0) continue;
|
|
12419
|
+
const others = more.length === 0 ? "" : ` The parser finds ${more.length} more ${more.length === 1 ? "fault" : "faults"} after it.`;
|
|
12420
|
+
breaks.push({
|
|
12421
|
+
file,
|
|
12422
|
+
line: first.line,
|
|
12423
|
+
message: `${file} does not parse as YAML, so GitHub starts no job of it: ${first.message}.${others}`
|
|
12424
|
+
});
|
|
12425
|
+
}
|
|
12426
|
+
return breaks;
|
|
12427
|
+
}
|
|
12428
|
+
};
|
|
12363
12429
|
// src/rules/workspace-protocol.ts
|
|
12364
12430
|
/**
|
|
12365
12431
|
* The rule `workspace-protocol`: a package uses another package of the workspace through `workspace:`.
|
|
@@ -12446,6 +12512,7 @@ const RULES = [
|
|
|
12446
12512
|
mainCheck,
|
|
12447
12513
|
testsRequired,
|
|
12448
12514
|
roadmapParses,
|
|
12515
|
+
workflowParses,
|
|
12449
12516
|
runnerBudget,
|
|
12450
12517
|
mainRunsFinish,
|
|
12451
12518
|
pushMainOnly,
|
|
@@ -12888,6 +12955,6 @@ function runMap(args, io) {
|
|
|
12888
12955
|
else io.stdout(mapText(found));
|
|
12889
12956
|
return 0;
|
|
12890
12957
|
}
|
|
12891
|
-
export {
|
|
12958
|
+
export { repositoryOfRemote as $, runGit as $t, blockHash as A, mergeHomes as At, publishedMinorRule as B, STRICT_OPTIONS as Bt, testsRequired as C, repoOf as Ct, pathsOf as D, findHomes as Dt, isSourcePath as E, MAP_RULE as Et, requiredScripts as F, gateTrigger as Ft, npmLookup as G, hasFile as Gt, NPM_REGISTRY as H, DEPENDENCY_FIELDS as Ht, releaseFiles as I, prPathFilters as It, pipeFails as J, lineOf as Jt, unreleasedChange as K, inFolder as Kt, lockedVersions as L, summaryName as Lt, sharedDocsRule as M, HOME_EXPORTS as Mt, roadmapOfLine as N, ACTIONS_COMMIT as Nt, sourceMain as O, mapMarkdown as Ot, roadmapParses as P, convertGate as Pt, pagesAfterRelease as Q, replaceLine as Qt, minorOf as R, gateAfterCancel as Rt, typedFiles as S, messageOf as St, tsconfigTest as T, HOMES as Tt, SHIPPED_FIELDS as U, cleanPath as Ut, reachOf as V, cuePreset as Vt, UNSHIPPED_FILES as W, codePackages as Wt, isPinned as X, parseJsonc as Xt, isGitSpecifier as Y, matchesAny as Yt, pinnedGitDeps as Z, readJsonc as Zt, TRAIN_SCOPES as _, licenseFileOf as _t, listRules as a, defaultOptions as an, pagesSite as at, configsOfScript as b, declaredName as bt, runCli as c, HOME_PATTERNS as ct, RULES as d, REAL_COMPARE as dt, specifiersOf as en, runnerBudget as et, workspaceProtocol as f, hasImportMetaMain as ft, IGNORE_AFTER as g, licenseFile as gt, yamlFaults as h, authorOf as ht, formatResult as i, workspaceGlobs as in, pagesCalls as it, githubFetch as j, readOverlay as jt, HOME_TIMEOUT_MS as k, mapText as kt, runFix as l, noLocalPaths as lt, workflowParses as m, LICENSE_TEXTS as mt, annotations as n, globToRegExp as nn, pushMainOnly as nt, readConfig as o, parseConfig as on, apiReportScript as ot, GITHUB_YAML as p, mainCheck as pt, unreleasedChangeRule as q, keyLine as qt, createContext as r, packageFolders as rn, PAGES_WORKFLOWS as rt, runChecks as s, DEFAULT_ALLOWED as st, USAGE as t, globFolders as tn, scheduleMinute as tt, summaryMarkdown as u, noBuildOutput as ut, trustPolicy as v, mitText as vt, hasTests as w, signaturesOf as wt, scriptsOf as x, homePackage as xt, typedScripts as y, repositoryIsPublic as yt, publishedMinor as z, readWorkflow as zt };
|
|
12892
12959
|
|
|
12893
|
-
//# sourceMappingURL=run
|
|
12960
|
+
//# sourceMappingURL=run-Bn3XU7rh.js.map
|