fix(ci): ignore generated website translation staging (#2511)
Ignore generator-owned website translation staging output while preserving authored lint errors and complete diagnostics. Verified with a real checker regression, a production translation build, complete coverage, developer/CI regression checks and native lanes. Fixes #2508
This commit is contained in:
@@ -72,3 +72,5 @@ Thumbs.db
|
|||||||
|
|
||||||
# Complete static website output, including generated language editions.
|
# Complete static website output, including generated language editions.
|
||||||
website/_site/
|
website/_site/
|
||||||
|
# Temporary translation output prepared before replacing the complete site.
|
||||||
|
website/.i18n-*/
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { spawnSync } from "node:child_process";
|
import { spawnSync } from "node:child_process";
|
||||||
import { access, mkdir, readFile, writeFile } from "node:fs/promises";
|
import { access, mkdir, readFile, writeFile } from "node:fs/promises";
|
||||||
import { join, sep } from "node:path";
|
import { dirname, join, sep } from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import { expect, it } from "vitest";
|
import { expect, it } from "vitest";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
@@ -138,6 +138,36 @@ it("keeps lint errors failing and visible alongside the retained warnings", asyn
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("excludes translation staging while retaining authored website errors", async () => {
|
||||||
|
const root = await fixture();
|
||||||
|
for (const name of [".gitignore", ".oxlintrc.json"])
|
||||||
|
await writeFile(join(root, name), await readFile(join(repository, name)));
|
||||||
|
const authored = "website/public/assets/authored.js";
|
||||||
|
const staged =
|
||||||
|
"website/.i18n-regression/site/examples/notes-electron/main.js";
|
||||||
|
for (const name of [authored, staged]) {
|
||||||
|
const path = join(root, name);
|
||||||
|
await mkdir(dirname(path), { recursive: true });
|
||||||
|
await writeFile(
|
||||||
|
path,
|
||||||
|
'const source = require("node:fs");\nconsole.log(source);\n',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = invoke(root, "lint");
|
||||||
|
expect(result.error).toBeUndefined();
|
||||||
|
expect(result.status).toBe(1);
|
||||||
|
expect(result.stdout).toContain("1 errors, 0 warnings");
|
||||||
|
expect(result.stderr).toContain(authored);
|
||||||
|
expect(await lintDiagnostics(root)).toEqual([
|
||||||
|
expect.objectContaining({
|
||||||
|
severity: "error",
|
||||||
|
code: "typescript(no-var-requires)",
|
||||||
|
filename: authored,
|
||||||
|
}),
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
it("keeps malformed source failing with its parser diagnostic", async () => {
|
it("keeps malformed source failing with its parser diagnostic", async () => {
|
||||||
const root = await fixture();
|
const root = await fixture();
|
||||||
await writeFile(join(root, "src/malformed.js"), "const value = ;\n");
|
await writeFile(join(root, "src/malformed.js"), "const value = ;\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user