mirror of
https://github.com/j178/prek.git
synced 2026-04-25 02:11:36 +02:00
65c29da7b6
* . * Improve some docs
1.4 KiB
1.4 KiB
Built-in Fast Hooks
Prek includes fast, Rust-native implementations of popular hooks for speed and low overhead. When a matching hook from a popular repository (for example, pre-commit/pre-commit-hooks) is detected, prek can run an internal implementation instead of spawning external interpreters.
Currently, only pre-commit/pre-commit-hooks is implemented. More popular repositories may be added over time.
Currently implemented hooks
https://github.com/pre-commit/pre-commit-hooks
trailing-whitespace(Trim trailing whitespace)check-added-large-files(Prevent committing large files)end-of-file-fixer(Ensure newline at EOF)fix-byte-order-marker(Remove UTF-8 byte order marker)check-json(Validate JSON files)check-toml(Validate TOML files)check-yaml(Validate YAML files)mixed-line-ending(Normalize or check line endings)
Notes:
check-yamlfast path does not yet support--unsafeor--allow-multiple-documentsflags; for those cases, fast path is skipped automatically.- Fast-path detection currently matches only the repository URL (e.g.,
https://github.com/pre-commit/pre-commit-hooks) and does not take therevinto account.
Disabling the fast path
If you need to compare with the original behavior or encounter differences:
PREK_NO_FAST_PATH=1 prek run
This forces prek to fall back to the standard execution path.