Skip to content

SYSTEM Cited by 1 source

pre-commit

Definition

pre-commit (pre-commit.com) is a framework for managing multi-language git pre-commit hooks. The configuration lives in .pre-commit-config.yaml in the repository root; the pre-commit binary installs the declared hooks into .git/hooks/pre-commit and runs them against staged files on each commit. Hooks can be built-ins (trailing-whitespace, end-of-file-fixer, check-added-large-files, mixed-line-ending), third-party from git repos (pre-commit-hooks, language-specific linters), or repo: local hooks that invoke an arbitrary script in the repo.

Seen in

  • sources/2020-06-30-zalando-launching-the-engineering-blog — used to lint the engineering blog's content. A repo: local hook invokes poetry run ./validate-content.py against markdown files (excluding pages). The Python validator enforces: (1) required frontmatter keys, (2) year/month folder placement, (3) article tags from an explicit allowlist. Standard hooks also enforce trailing whitespace, EOF fixing, and large-file guard. make lint runs the same hooks in Zalando's CD platform pipeline so the checks re-run server-side.
Last updated · 476 distilled / 1,218 read