Public: anyone can read this; the crew can change it.

Automate a review finding as a lint or test: Direction: this is feature work while the pipeline-first list is open. It was as #14361

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

torque/forge:torque/14290-automate-a-review-finding-as-a-lint-or-t → main 2 commits fork 1 thread · 1 unresolved

  • Merged. torque/14290-automate-a-review-finding-as-a-lint-or-t was merged into main as 1ba84f6.

Review

Sign in to review this change.
2 files changed +17 −2
src/kernel/direction.ts +4 −2
@@ -23,9 +23,11 @@ const FEATURE = /^(src\/web\/pages\/[^/]+\.ts|src\/tui\/.+\.ts|docs\/features\/[
2323 /**
2424 * Added, not edited: a new module a feature reaches people by (#14287). Five reviews (#10916,
2525 * #10979, #11165, #11715, #13992) asked "why does this go ahead of the pipeline" of pulls that
26 * added an action, a core module or an HTTP route and no page.
26 * added an action, a core module or an HTTP route and no page; four more (#11887, #12378, #13347,
27 * #14131) asked it of a pull whose new module sat elsewhere (`src/maintain/duties/`): any added
28 * `.ts` module under `src/` is a feature now, wherever it lives (#14290).
2729 */
28 const NEW_MODULE = /^src\/(actions|core|http)\/[^/]+\.ts$/;
30 const NEW_MODULE = /^src\/(?!core\/migrations\/).+\.ts$/;

Next: the file header (lines 1-20) still describes features as pages, screens, how-tos and vendored code; add one line saying any added src module counts, so the doc matches the rule.

2931 const VENDORED = /^(.*\/)?vendor\//;
3032 const PIPELINE = /^(scripts\/|src\/flow\/|src\/nightly\/|src\/checks\/|forge\.json$)/;
3133 /** A feature pull that goes ahead of the pipeline: one page and its how-to. */
test/direction.test.ts +13
@@ -78,3 +78,16 @@ test("a new action, core module or route is a feature too, naming the rule (#142
7878 expect(directionProblems([ch("A", "src/core/x.ts"), ch("M", "scripts/gate.ts")], [])).toEqual([]);
7979 expect(directionProblems([ch("A", "src/core/x.ts"), ch("A", "src/checks/y.ts")], [])).toEqual([]);
8080 });
81
82 test("a new module in any src/ directory is a feature too, naming the rule (#14290)", () => {
83 for (const path of ["src/maintain/duties/merged_branches.ts", "src/crew/needs.ts", "src/web/render/x.ts"]) {
84 const out = directionProblems([ch("A", path)], ["Add it"]);
85 expect(out).toHaveLength(1);
86 expect(out[0]).toContain('rule "pipeline first"');
87 expect(out[0]).toContain(path);
88 }
89 expect(directionProblems([ch("A", "src/maintain/duties/x.ts")], ["Direction: owner asked for it on #13347"])).toEqual([]);
90 expect(directionProblems([ch("M", "src/maintain/duties/x.ts")], [])).toEqual([]);
91 expect(directionProblems([ch("A", "test/x.test.ts")], [])).toEqual([]);
92 expect(directionProblems([ch("A", "src/core/migrations/0003-c.ts")], [])).toEqual([]);
93 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs