Verification · Hygiene · File hygiene
Merge marker and whitespace checks
Reject conflict markers, trailing whitespace and missing final newlines.
How to build it
- Enable check-merge-conflict, trailing-whitespace and end-of-file-fixer from pre-commit-hooks.
- Run the hooks on staged files locally and on all files in CI.
- Fix existing hits in one commit before making the hooks required.
Signals in a repository
- check-merge-conflict, trailing-whitespace or end-of-file-fixer ids in .pre-commit-config.yaml.
- A CI job that runs pre-commit run --all-files.
- No tracked text file contains lines starting with <<<<<<< or >>>>>>>.
In practice
33 repositories run a tool for this check in the scanned set.
pre-commit-hooks· 33 repos
Examples
-
TheAlgorithms/Python ·
pre-commit-hookspre-commit hook check-executables-have-shebangs -
langchain-ai/langchain ·
pre-commit-hookspre-commit hook check-yaml -
langflow-ai/langflow ·
pre-commit-hookspre-commit hook check-case-conflict -
fastapi/fastapi ·
pre-commit-hookspre-commit hook check-added-large-files -
ggml-org/llama.cpp ·
pre-commit-hookspre-commit hook trailing-whitespace