From 7c10cb4459b5920568fe2a93da369acde0de923f Mon Sep 17 00:00:00 2001 From: Dan Mo Date: Sat, 31 Oct 2026 16:16:27 +1100 Subject: [PATCH] Size and complexity lint growth warns during feature work (h3-studio#899) Owner 2026-10-31: build features without fighting size limits, refactor afterwards. check:lint now prints complexity and max-lines-per-function growth as warnings; every other ratcheted rule still fails. --- studio-app/tools/check-lint.mjs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/studio-app/tools/check-lint.mjs b/studio-app/tools/check-lint.mjs index 4a199f9a..1c478b40 100644 --- a/studio-app/tools/check-lint.mjs +++ b/studio-app/tools/check-lint.mjs @@ -28,11 +28,17 @@ if (process.argv.includes('--update')) { process.exit(0); } const baseline = JSON.parse(readFileSync(baselineFile, 'utf8')); +// Owner 2026-10-31: size and complexity only warn while a feature is built; it is +// refactored afterwards (h3-studio#899). Correctness rules still fail. +const STRUCTURE = new Set(['complexity', 'max-lines-per-function']); const grown = []; for (const [rule, files] of Object.entries(counts)) for (const [file, n] of Object.entries(files)) { const was = baseline.files[rule]?.[file] || 0; - if (n > was) grown.push(`${file}: ${rule} ${n} (was ${was})`); + if (n <= was) continue; + const line = `${file}: ${rule} ${n} (was ${was})`; + if (STRUCTURE.has(rule)) console.warn('warn (refactor later) ' + line); + else grown.push(line); } if (grown.length) { for (const line of grown) console.error(line);