From 46f86c009177374424bab96d263b01ce1074a205 Mon Sep 17 00:00:00 2001 From: Bruno Miiller Date: Tue, 19 May 2026 23:07:36 -0300 Subject: [PATCH] Tighten CI: coverage ratchet at 8% and ignore build artifacts - package.json: test:coverage adds --check-coverage --lines=8 (current baseline is 8.32%; floor only goes up) - biome.json: ignore *.main.js webpack chunks, coverage/, node_modules/ - docs/CONTRIBUTING.md: document ratchet policy and long-term 70% target --- biome.json | 2 +- docs/CONTRIBUTING.md | 13 ++++++++++++- package.json | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/biome.json b/biome.json index 9623dda..a025314 100644 --- a/biome.json +++ b/biome.json @@ -4,7 +4,7 @@ "enabled": true }, "files": { - "ignore": ["main.js"] + "ignore": ["main.js", "*.main.js", "coverage/**", "node_modules/**"] }, "formatter": { "enabled": true, diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index e36d9ea..ee7e3ce 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -52,5 +52,16 @@ Citar o PR upstream na mensagem de commit (`baseado no PR upstream #`). ## Testes - Toda feature ou bugfix inclui teste -- Cobertura mínima do core: a definir (atualmente sem threshold) - Localização: `tests/` para src/, `pro/tests/` para pro/ +- Comando: `npm run test:coverage` + +### Política de cobertura (ratchet) + +Cobertura mínima de linhas é um **piso que só sobe**. Atualmente em `8%` +(via `c8 --check-coverage --lines=8` no script `test:coverage`). + +Quando você adicionar testes que elevam a cobertura geral, **suba o piso** +no script `test:coverage` para o novo valor (truncado). Nunca abaixar. + +Meta de longo prazo: 70% (padrão code-standards). Áreas zero-cobertura +prioritárias: `src/main.ts`, `src/settings.ts`, backends `fs*.ts`. diff --git a/package.json b/package.json index 0b220dc..f299eb0 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "format": "npx @biomejs/biome check --write .", "clean": "npx rimraf main.js", "test": "mocha --import=tsx 'tests/**/*.ts' 'pro/tests/**/*.ts'", - "test:coverage": "c8 --reporter=text --reporter=lcov --reporter=html npm test" + "test:coverage": "c8 --check-coverage --lines=8 --reporter=text --reporter=lcov --reporter=html npm test" }, "browser": { "path": "path-browserify",