
Modernizing Workflows with Pre-commit Hooks in Drupal
When managing a Drupal distribution for a massive intergovernmental corporation with developers working across three continents, "code review" cannot be the first line of defense against poor syntax. By the time a senior architect is reviewing a Pull Request, it is too late to argue about indentations or missing docblocks. In evaluating a custom upstream ( CHG0099785 ), we noticed that CI pipelines were continuously failing due to trivial PHPCS (PHP CodeSniffer) violations, creating massive bottlenecks in the merge cycle. The Cost of Late Detection If a developer submits a PR with a tab instead of two spaces , the CI pipeline still consumes 5 to 10 minutes to spin up the container, run the automated tests, and eventually fail on the syntax check. Multiply 10 minutes of wait time by 20 developers committing 3 times a day, and the organization hemorrhaged hundreds of hours a week strictly waiting for Jenkins/GitLab to tell them they missed a semicolon. Shift-Left: Enforcing the Edge To s
Continue reading on Dev.to
Opens in a new tab

