pre-commit reimplemented in Rust
Project description
pre-commit-rs
A reimplementation of the pre-commit tool in Rust, providing a faster and dependency-free alternative. It aims to be a drop-in replacement for the original tool while also providing some more advanced features.
[!WARNING] This project is still in very early development, only a few of the original pre-commit features are implemented. It is not recommended for normal use yet, but feel free to try it out and provide feedback.
Features
- A single binary with no dependencies, does not require Python or any other runtime.
- Improved performance in hook preparation and execution.
- Fully compatible with the original pre-commit configurations and hooks.
- (TODO) Built-in support for monorepos.
- (TODO) Built-in implementation of some common hooks.
- (TODO) Integration with
uv
for managing Python tools and environments.
Installation
Standalone installer
pre-commit-rs
provides a standalone installer script to download and install the tool:
# On Linux and macOS
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/pre-commit-rs/releases/download/v0.0.5/pre-commit-rs-installer.sh | sh
# On Windows
powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/pre-commit-rs/releases/download/v0.0.5/pre-commit-rs-installer.ps1 | iex"
PyPI
pre-commit-rs
is published as Python binary wheel to PyPI under the name pre-commit-rusty
,
you can install it using pip
, uv
(recommended), or pipx
:
pip install pre-commit-rusty
# or
uv tool install pre-commit-rusty
# or
pipx install pre-commit-rusty
Homebrew
brew install j178/tap/pre-commit-rs
Cargo
Build from source using Cargo:
cargo install --locked pre-commit-rs
Install from the binary directly using cargo binstall
:
cargo binstall pre-commit-rs
GitHub Releases
pre-commit-rs
release artifacts can be downloaded directly from the GitHub releases.
Usage
[!NOTE] The binary executable is named
pre-commit
(orpre-commit.exe
on Windows) - without the-rs
suffix. It should be available in yourPATH
after installation.
This tool is designed to be a drop-in replacement for the original pre-commit tool, so you can use it with your existing configurations and hooks.
Please refer to the official documentation for more information on how to configure and use pre-commit.
Acknowledgements
This project is heavily inspired by the original pre-commit tool, and it wouldn't be possible without the hard work of the maintainers and contributors of that project.
And a special thanks to the Astral team for their remarkable projects, particularly uv, from which I've learned a lot on how to write efficient and idiomatic Rust code.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file pre_commit_rusty-0.0.5.tar.gz
.
File metadata
- Download URL: pre_commit_rusty-0.0.5.tar.gz
- Upload date:
- Size: 92.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd9eed6d7ddd719920119e4079598da3faf3b0dcc68acde30224f9c1341f1157 |
|
MD5 | 680eb9358b8b80ad94be09f213218420 |
|
BLAKE2b-256 | 0b6065e4f431338c458697efcc6f606758bf46dc3c2a452a1d932d2e96d288e2 |
File details
Details for the file pre_commit_rusty-0.0.5-py3-none-win_amd64.whl
.
File metadata
- Download URL: pre_commit_rusty-0.0.5-py3-none-win_amd64.whl
- Upload date:
- Size: 4.4 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | adb122648de257b0d0ae0819719e7e55df1573559ead6a302b3fb5b3a1dd2502 |
|
MD5 | f3b36c40ef4952fd5c0356630be77337 |
|
BLAKE2b-256 | a229c88b0c932c18119949d7cbb862da85b3447d4fc9f12cb5df1bfa48240f8f |
File details
Details for the file pre_commit_rusty-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pre_commit_rusty-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.4 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 147e48064aa6ca1747df0575c2b63cf1b86b20ec3e361ae1994d319932045e9d |
|
MD5 | 736a56e4cf0f63f537a3652a0584e0d7 |
|
BLAKE2b-256 | cf014af8afb75d034a8eea2f81834500e3174a771bb84c6cfbd0428c995fff4f |
File details
Details for the file pre_commit_rusty-0.0.5-py3-none-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pre_commit_rusty-0.0.5-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.7 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5356fefb87364ac0c19ac96819f864c25ed6ac99a73123c0f89860510ded75f |
|
MD5 | e0a304af75ba909e0764d5f7ff167c90 |
|
BLAKE2b-256 | e16644e2a729a462f32f7330c88a2e1027beb79c8bbd20e247e07b46893ad2a9 |
File details
Details for the file pre_commit_rusty-0.0.5-py3-none-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: pre_commit_rusty-0.0.5-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 5.0 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7a32995aff8de695b112f94ecad94d7496b82de548d7be5bd5b7487b03f19b6 |
|
MD5 | 9a28bf63db9db74d570043e6581859a0 |
|
BLAKE2b-256 | efdf0f1b52bc7b4d71d1254500fe97b0c089c9387f4744034592925f226efeea |