Skip to main content

pre-commit reimplemented in Rust

Project description

pre-commit-rs

Development Status CI

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.4/pre-commit-rs-installer.sh | sh

# On Windows
powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/pre-commit-rs/releases/download/v0.0.4/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 (or pre-commit.exe on Windows) - without the -rs suffix. It should be available in your PATH 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pre_commit_rusty-0.0.4.tar.gz (24.9 kB view details)

Uploaded Source

Built Distributions

pre_commit_rusty-0.0.4-py3-none-win_amd64.whl (4.4 MB view details)

Uploaded Python 3 Windows x86-64

pre_commit_rusty-0.0.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ x86-64

pre_commit_rusty-0.0.4-py3-none-macosx_11_0_arm64.whl (4.7 MB view details)

Uploaded Python 3 macOS 11.0+ ARM64

pre_commit_rusty-0.0.4-py3-none-macosx_10_12_x86_64.whl (5.0 MB view details)

Uploaded Python 3 macOS 10.12+ x86-64

File details

Details for the file pre_commit_rusty-0.0.4.tar.gz.

File metadata

  • Download URL: pre_commit_rusty-0.0.4.tar.gz
  • Upload date:
  • Size: 24.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.5.4

File hashes

Hashes for pre_commit_rusty-0.0.4.tar.gz
Algorithm Hash digest
SHA256 a160d32a143007e3964ad2eaaa51a776eee14fcc21ad7f26f624cb5238e3dc3f
MD5 179276d472a15dace57f88cf5bc60669
BLAKE2b-256 2e03b554cf76ca8c9a67c21528918d356b79f8a0d34f2e956a22fefe768b4994

See more details on using hashes here.

File details

Details for the file pre_commit_rusty-0.0.4-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for pre_commit_rusty-0.0.4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 771c194e26a50cfba9b29fecd0127cb2fb7c0d9a3e70a142a1d696e10852f5b6
MD5 c36f2e689a8559bc8c030b11ef3ae585
BLAKE2b-256 13c2a429a3fe27dabb42d8b801fe15374ac275c09481d05b7cfbfb01f5a6241d

See more details on using hashes here.

File details

Details for the file pre_commit_rusty-0.0.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pre_commit_rusty-0.0.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 26fccda019bb0985bdb2d37d3734232de99b37f42359fac7b03a10320cdbd25b
MD5 7ecb6c096204d2bd9889465b5b46798b
BLAKE2b-256 63077238afe839bc530d775b570b7f4edc9abd7b500bb06396e7d500a15ed9f4

See more details on using hashes here.

File details

Details for the file pre_commit_rusty-0.0.4-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pre_commit_rusty-0.0.4-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 500b5a8a6f73ebc56b9229eef2e91117827e9ec289eee1265eee043fd3dd419d
MD5 b23616fdf2a9f5a2f4801793611292a2
BLAKE2b-256 5585328bb1bbe5eac1c4ff9d04e995caf946d4c1583c085e27d18bc0dfd2b26b

See more details on using hashes here.

File details

Details for the file pre_commit_rusty-0.0.4-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pre_commit_rusty-0.0.4-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 878b1a6e91bfc7ed08e76212db0d700bf6753fad5a6cfdcc9910abc3d9db8635
MD5 bb511df39f594d1e68d91bb44e86d6bf
BLAKE2b-256 834a8554a050a6b41121383cff0d7dde6e0938363e16d54807e9e0d91e7c4092

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page