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: localhook invokespoetry run ./validate-content.pyagainst 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 lintruns the same hooks in Zalando's CD platform pipeline so the checks re-run server-side.