GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(scripts): check:changed lints Astro components and runs knip for … · pingdotgg/t3code@9284b2b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • scripts
    • check-changed.test.ts
    • check-changed.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎scripts/check-changed.test.ts‎

Copy file name to clipboardExpand all lines: scripts/check-changed.test.ts
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,17 @@ it("checks changed source paths through the Windows launcher", () => {
407407
expect(result.stdout).toContain("fixture stderr: lint");
408408
});
409409

410+
it("lints an Astro component and runs knip when only it changed", () => {
411+
using project = launcherFixture();
412+
const page = "packages/example/Page.astro";
413+
project.write(page, "---\nconst title = 1;\n---\n<h1>{title}</h1>\n");
414+
const result = project.run();
415+
expect(result.status, result.stdout + result.stderr).toBe(0);
416+
const calls = project.calls();
417+
expect(calls.find(({ args }) => args[0] === "lint")?.args).toEqual(["lint", page]);
418+
expect(calls.some(({ args }) => args[0] === "exec" && args[1] === "knip")).toBe(true);
419+
});
420+
410421
it.each(["install", "lint"])("reports a failing %s step with its output", (step) => {
411422
using project = launcherFixture();
412423
project.write(project.source, "export const value = 2;\n");
Collapse file

‎scripts/check-changed.ts‎

Copy file name to clipboardExpand all lines: scripts/check-changed.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ export const comparisonBase = Effect.fn("checkChanged.comparisonBase")(function*
172172
return closest;
173173
});
174174

175-
const CODE = /\.[cm]?[jt]sx?$/;
175+
// CI's lint and knip also read Astro components' frontmatter.
176+
const CODE = /\.(?:[cm]?[jt]sx?|astro)$/;
176177
const TEST = /\.test\.[cm]?[jt]sx?$/;
177178
// CI runs the .github/scripts tests with `node --test`; vitest passes a failing node:test file.
178179
const NODE_TEST = /^\.github[/\\]scripts[/\\]/;

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.