mirror of
https://github.com/j178/prek.git
synced 2026-04-03 17:34:03 +02:00
Checking the pre-commit documentation and the source code of prek will reveal that this is named language_version rather than language-version. It's a tiny nit but a little confusing otherwise
1.7 KiB
1.7 KiB
Difference from pre-commit
General differences
preksupports both.pre-commit-config.yamland.pre-commit-config.ymlconfiguration files.prekimplements some common hooks frompre-commit-hooksin Rust for better performance.prekuses~/.cache/prekas the default cache directory for repos, environments and toolchains.prekdecoupled hook environment from their repositories, allowing shared toolchains and environments across hooks.preksupportslanguage_versionas a semver specifier and automatically installs the required toolchains.
Workspace mode
prek supports workspace mode, allowing you to run hooks for multiple projects in a single command. Each subproject can have its own .pre-commit-config.yaml file.
See Workspace Mode for more information.
Python support
preksupports Python toolchain management, it will install the required Python versions automatically.prekusesuvfor creating virtual environments and installing dependencies.preksupports Python hooks with PEP 723 inline metadata.
prek run
prekprovides dynamic completions of hook id.prek run --last-committo run hooks on files changed by the last commit.prek run --directory <DIR>to run hooks on a specified directory.prek run [HOOK_ID] [HOOK_ID] ...to run multiple hooks.
prek list
prek list command lists all available hooks, their ids, and descriptions. This provides a better overview of the configured hooks.
prek sample-config
prek sample-configcommand has a--fileoption to write the sample configuration to a specific file.
Future plans
- Global configurations.