mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
Collapse duplicate CI spend while keeping each gate's existence reason: - quality.yml: TIA __RUN_ALL__ defers full unit to fast-unit 4-shard (#6781); path filters via classify-pr-changes; docs-gates split; draft skip - ci.yml: wire docs/i18n/code path filters; ESLint JSON artifact for quality-gate; drop advisory typecheck:noimplicit; float actions/cache@v6 - TIA parity: memory/usage/combo/serial; **/*.test.mjs any depth; electron/bin no longer force unit __RUN_ALL__ - check:complexity-ratchets: one ESLint walk, ruleId-isolated baselines + cache - check:api-docs-refs + lib/apiRoutes: shared API route inventory - husky pre-push: intentionally light (gates live in pre-commit); CLAUDE.md + QUALITY_GATES.md docs synced - collect-metrics / lint:json: path.resolve cache path; Windows-safe eslint bin - env-doc allowlist for ESLINT_RESULTS_JSON / COMPLEXITY_ESLINT_REPORT - release-green --full-ci expects check:api-docs-refs (not docs-symbols alone) Tests: select-impacted, classify-pr-changes, api-routes lib, complexity-rule-count, validate-release-green. Reconciled after #6781 (fast-unit 2→4 shards) per maintainer request on #6716. Co-authored-by: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com>
62 lines
1.7 KiB
JavaScript
62 lines
1.7 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Single ESLint pass that always writes a JSON report for quality:collect.
|
|
*
|
|
* Existence reason: one inventory of net-new issues (vs suppressions) should
|
|
* feed both the blocking lint gate and the eslintWarnings ratchet — not two
|
|
* cold full-tree walks on different runners.
|
|
*
|
|
* Exit code: ESLint's own (0 = clean, 1 = errors). Warnings do not fail by
|
|
* default (same as `npm run lint`); pass --max-warnings=0 for lint-guard.
|
|
*/
|
|
import { spawnSync } from "node:child_process";
|
|
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
|
const outFile = path.resolve(
|
|
root,
|
|
process.env.ESLINT_RESULTS_JSON || path.join(".artifacts", "eslint-results.json")
|
|
);
|
|
|
|
fs.mkdirSync(path.dirname(outFile), { recursive: true });
|
|
|
|
const extra = process.argv.slice(2);
|
|
const eslintBin = path.join(
|
|
root,
|
|
"node_modules",
|
|
".bin",
|
|
process.platform === "win32" ? "eslint.cmd" : "eslint"
|
|
);
|
|
const args = [
|
|
".",
|
|
"--cache",
|
|
"--cache-location",
|
|
".eslintcache",
|
|
"--suppressions-location",
|
|
"config/quality/eslint-suppressions.json",
|
|
"--format",
|
|
"json",
|
|
"--output-file",
|
|
outFile,
|
|
...extra,
|
|
];
|
|
|
|
const result = spawnSync(eslintBin, args, {
|
|
cwd: root,
|
|
encoding: "utf8",
|
|
shell: process.platform === "win32",
|
|
maxBuffer: 256 * 1024 * 1024,
|
|
});
|
|
|
|
if (result.stdout) process.stdout.write(result.stdout);
|
|
if (result.stderr) process.stderr.write(result.stderr);
|
|
|
|
if (!fs.existsSync(outFile)) {
|
|
// ESLint may crash before writing; leave an empty array so collectors don't explode.
|
|
fs.writeFileSync(outFile, "[]\n");
|
|
}
|
|
|
|
process.exit(result.status === null ? 1 : result.status);
|