Higiene de PR antes da primeira feature de domínio. - Tags Nx canônicas (scope/type/domain) em todos os 5 projetos, incluindo e2e - depConstraints ESLint: scope:api|web|shared + type:app|e2e|feature|util|data - Husky 9 + lint-staged: eslint --max-warnings=0 + prettier --check em pre-commit - commitlint @conventional: tipo obrigatório, scope enum warn, body ilimitado - gitleaks via Docker: zero leaks no tree completo; allowlist .agents/,.claude/,tmp/ - tmp/ adicionado ao .gitignore (relatórios de scan locais) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 lines
671 B
Bash
Executable File
22 lines
671 B
Bash
Executable File
#!/usr/bin/env sh
|
|
# SAR pre-commit: lint-staged → gitleaks
|
|
|
|
pnpm exec lint-staged
|
|
|
|
# Gitleaks — detecta segredos antes de empurrar pro Gitea.
|
|
# Roda via Docker para não exigir instalação local.
|
|
# Fallback silencioso se Docker não estiver disponível (CI tem o binário nativo).
|
|
if command -v docker > /dev/null 2>&1 && docker info > /dev/null 2>&1; then
|
|
docker run --rm \
|
|
-v "$(pwd)":/path \
|
|
-w /path \
|
|
zricethezav/gitleaks:latest detect \
|
|
--config .gitleaks.toml \
|
|
--source . \
|
|
--no-git \
|
|
--redact \
|
|
--exit-code 1
|
|
else
|
|
echo "[pre-commit] Docker indisponível — gitleaks pulado (rode manualmente antes de push)"
|
|
fi
|