Skip to main content

pre-commit reimplemented in Rust

Project description

prefligit

Development Status CI

prefligit

A reimplementation of the pre-commit tool in Rust, designed to be a faster, dependency-free and drop-in alternative, while also providing some additional opinionated features.

[!WARNING] This project is still in early stage of development, only a few of the original pre-commit features are implemented. It is not production-ready yet, but feel free to try it out and provide feedback.

Current supported languages are python, nodejs, docker, docker-image, system, script and fail.

[!NOTE] This project was previously named pre-commit-rs, but it was renamed to prefligit to prevent confusion with the existing pre-commit tool. See #73 for more information.

Features

  • A single binary with no dependencies, does not require Python or any other runtime.
  • Fully compatible with the original pre-commit configurations and hooks.
  • Improved performance in hook preparation and execution.
  • Integration with uv for managing Python virtual environments and dependencies.
  • Improved toolchain installations for Python, Node.js, Go, Rust and Ruby, shared between hooks.
  • Built-in implementation of some common hooks.
  • (TODO) Built-in support for monorepos.

Usage

$ prefligit run
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
typos....................................................................Passed
cargo fmt................................................................Passed
cargo clippy.............................................................Passed

Installation

Standalone installer

prefligit 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/prefligit/releases/download/v0.0.15/prefligit-installer.sh | sh

# On Windows
powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prefligit/releases/download/v0.0.15/prefligit-installer.ps1 | iex"
PyPI

prefligit is published as Python binary wheel to PyPI, you can install it using pip, uv (recommended), or pipx:

pip install prefligit

# or

uv tool install prefligit

# or

pipx install prefligit
Homebrew
brew install j178/tap/prefligit
Cargo

Build from source using Cargo:

cargo install --locked --git https://github.com/j178/prefligit
GitHub Releases

prefligit release artifacts can be downloaded directly from the GitHub releases.

Usage

This tool is designed to be a drop-in alternative 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

prefligit-0.0.15.tar.gz (129.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

prefligit-0.0.15-py3-none-win_amd64.whl (4.2 MB view details)

Uploaded Python 3Windows x86-64

prefligit-0.0.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

prefligit-0.0.15-py3-none-macosx_11_0_arm64.whl (4.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

prefligit-0.0.15-py3-none-macosx_10_12_x86_64.whl (4.8 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file prefligit-0.0.15.tar.gz.

File metadata

  • Download URL: prefligit-0.0.15.tar.gz
  • Upload date:
  • Size: 129.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.4

File hashes

Hashes for prefligit-0.0.15.tar.gz
Algorithm Hash digest
SHA256 551d94136ddd0becdd39cf5d297d1426e5469eabbc5b820f9a69f9421ff26a79
MD5 11210aec820bf19c3fac428d6ff20ce9
BLAKE2b-256 be1173ec577f1baa624f6ac4472e77f9cecd8dd732e8ba6e00ec778f698321d6

See more details on using hashes here.

File details

Details for the file prefligit-0.0.15-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for prefligit-0.0.15-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6c2db84aad15ad9f9e7b3db80f89e3fde28d30324475a26cb1a03c90b4cf4cb4
MD5 5b1cdddfa3928d1efac069a9b99cacf6
BLAKE2b-256 b835a84c3df12c9ae81d1b5cc468413b70f1f6776f45959bf52dba9f3cc4e390

See more details on using hashes here.

File details

Details for the file prefligit-0.0.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for prefligit-0.0.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 124c5ba661f1faef831f65b5f1a600bb76531635c262d3ed95df3b8c1dade036
MD5 166db83580a710ab76ddef64fd0a345a
BLAKE2b-256 5e64fbc43845f7b5a7f454528693de17077b2ee6475a6a834bf69adde714420f

See more details on using hashes here.

File details

Details for the file prefligit-0.0.15-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for prefligit-0.0.15-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 503ad6245fc717fce28dac2b7f7425b5f60756e19cda6af995f26086bece3416
MD5 025003330c8b7dd139d0ca4a866a47af
BLAKE2b-256 207d4e1efa9af724b72b6fd73b18a24f63f0dfbebf2615a5980ef567b163f698

See more details on using hashes here.

File details

Details for the file prefligit-0.0.15-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for prefligit-0.0.15-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 851f976437328aca4d421b38ad2979c30b4c84fe35c69081769b29a43950fdce
MD5 46719d4bad18a89db63b28f82d24b2b9
BLAKE2b-256 d7c52c49620a1b4b51a6c862677577fc26e7a0331ed28acbb6e223704d6d350d

See more details on using hashes here.

Supported by

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