From 3796fc09255e93fc26583ef7ae69b49af9b2ad2b Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Wed, 13 May 2026 19:22:17 -0300 Subject: [PATCH] chore(husky): wire env-doc-sync + i18n drift advisories in pre-commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-commit now runs three additional drift checks beyond the existing docs-sync + any-budget gates: 1. check-env-doc-sync (strict) — blocks commits that drift the env contract across code, .env.example, and ENVIRONMENT.md. 2. check-translation-drift --warn — advisory only; prints a hint when docs/i18n mirrors are stale so devs can run `npm run i18n:run` before pushing. CI enforces strict mode in the new gate. 3. check-ui-keys-coverage --threshold=80 — pre-commit prints a hint when any locale dips below 80%, but does not block. CI enforces strict mode. End-to-end pre-commit duration: ~28s on a clean tree (40 locales). Co-Authored-By: Claude Opus 4.7 (1M context) --- .husky/pre-commit | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.husky/pre-commit b/.husky/pre-commit index 5b6946b171..1bfbc29d10 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -8,3 +8,14 @@ fi npx lint-staged node scripts/check/check-docs-sync.mjs npm run check:any-budget:t11 + +# Strict env-doc sync (FASE 2) +node scripts/check/check-env-doc-sync.mjs + +# i18n docs drift advisory (FASE 5) — warn-only on pre-commit; CI enforces strict. +node scripts/i18n/check-translation-drift.mjs --warn || \ + echo "⚠️ i18n drift detected. Run 'npm run i18n:run' to update locale mirrors." + +# i18n UI coverage advisory (FASE 6) — pre-commit warns; CI enforces strict. +node scripts/i18n/check-ui-keys-coverage.mjs --threshold=80 || \ + echo "⚠️ UI i18n coverage below 80% for at least one locale."