Compatibility with pre-commit¶
prek is designed to be a practical drop-in replacement for pre-commit.
- Existing
.pre-commit-config.yamland.pre-commit-config.ymlfiles work unchanged. See Configuration. - Most day-to-day
pre-commitcommands work unchanged inprek.
Command and flag differences¶
Only the commands and flags below differ from the preferred prek spelling. The compatibility forms are still accepted so existing scripts do not break.
prek install-hooksstill works, butprek prepare-hooksis the preferred spelling.prek install --install-hooksstill works, butprek install --prepare-hooksis the preferred flag spelling.prek autoupdatestill works, butprek auto-updateis the preferred spelling.prek gcstill works as a hidden compatibility command, butprek cache gcis preferred.prek cleanstill works as a hidden compatibility command, butprek cache cleanis preferred.prek init-templatedirandprek init-template-dirstill work as hidden compatibility commands, butprek util init-template-diris preferred.pre-commit hazmatis not implemented inprek.pre-commit migrate-configis not provided as a direct command. Useprek util yaml-to-tomlif you want to migrate from YAML toprek.toml.
If you need strict upstream portability, stay with the YAML config format and avoid prek-only features such as prek.toml, repo: builtin, glob mappings for files and exclude, and workspace mode. See Configuration and Differences.