Pre-Commit Hook - Definição do Glossário de CI/CD
Um pre-commit hook roda verificações antes de um commit ser registrado, bloqueando-o se o lint ou os testes falharem.
Um pre-commit hook é um script que o Git roda antes de um commit ser registrado. Ele pode fazer lint, format ou testar mudanças staged e abortar o commit se as verificações falharem, capturando problemas antes que cheguem à CI.
Feedback local rápido
Pre-commit hooks fazem shift left das verificações para a máquina do desenvolvedor, capturando problemas em segundos, de modo que a CI não seja gasta com falhas triviais de estilo. A CI ainda deve reexecutar as verificações como fonte da verdade.
Guias relacionados
Git Hook - CI/CD Glossary DefinitionGit Hook: A Git hook is a script Git runs automatically at points in its workflow, such as before a commit, b…
Linting - CI/CD Glossary DefinitionLinting: Linting is automated static checking that flags programming errors, bugs, stylistic issues, and susp…
Shift Left - CI/CD Glossary DefinitionShift Left: Shift left is moving testing, security, and quality checks earlier in the delivery process, so de…