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, do 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.3/pre-commit-rs-installer.sh | sh

# On Windows
powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/pre-commit-rs/releases/download/v0.0.3/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.3.tar.gz (85.1 kB view details)

Uploaded Source

Built Distributions

pre_commit_rusty-0.0.3-py3-none-win_amd64.whl (4.6 MB view details)

Uploaded Python 3 Windows x86-64

pre_commit_rusty-0.0.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ x86-64

pre_commit_rusty-0.0.3-py3-none-macosx_11_0_arm64.whl (4.9 MB view details)

Uploaded Python 3 macOS 11.0+ ARM64

pre_commit_rusty-0.0.3-py3-none-macosx_10_12_x86_64.whl (5.1 MB view details)

Uploaded Python 3 macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pre_commit_rusty-0.0.3.tar.gz
Algorithm Hash digest
SHA256 b255a4dde6a644a63cd503f1f5aace3abfa7c0dbd843633f046593e27f7f1ad7
MD5 60d387ce7222131213af093f856271b1
BLAKE2b-256 f6084e6c7b63f27c551dae97d375d30bf9b05438be05a3e872f825ccac239871

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pre_commit_rusty-0.0.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4e5dde1ada9870b8b6bb0ddd0131a479d6b2286f8e004cadeb747e8093cc54a1
MD5 e78015c860ba8af67d69e0038df1241a
BLAKE2b-256 7f8335034606b065859a1129b889e1300ea9242f0079a53dbe1a01320ecc88ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pre_commit_rusty-0.0.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 19a47e80455588822986f90cbc98d5b6edd8ffbe45e6b3da2ed5a882cafbe5db
MD5 d2978de3c0f3d353ae9764cd0952649d
BLAKE2b-256 09d16b0400989457a5d579ff3a0e6101bf11a7faf10ae18b77fa63bd62c17850

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pre_commit_rusty-0.0.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 79ca4a2ba032b09a2984b7caf77abfe8f83cd7605edfa6f940f2f8ef449992fa
MD5 7f4f777470331712568b15fe1807cf0e
BLAKE2b-256 e8ae3862c8dd0b0baac1a17779d697982a5c9cc1939fbde930f4f4b978328cd2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pre_commit_rusty-0.0.3-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2f27870e0f620e18a609c3ec03922328b9ba6efb1143c4677f6c7b6bd58e7620
MD5 d86200089e99fd3473c29b44e7ad522d
BLAKE2b-256 430125c04bd25e901ac1f92eb8df8603ea5c09f8cea6662cf2f56b6c9350e235

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