Skip to main content

Better `pre-commit`, re-engineered 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

prefligit 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.

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.16/prefligit-installer.sh | sh

# On Windows
powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prefligit/releases/download/v0.0.16/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 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.

If installed via the standalone installer, prefligit can update itself to the latest version:

$ prefligit self update

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.16.tar.gz (131.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.16-py3-none-win_amd64.whl (4.2 MB view details)

Uploaded Python 3Windows x86-64

prefligit-0.0.16-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.16-py3-none-macosx_11_0_arm64.whl (4.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

prefligit-0.0.16-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.16.tar.gz.

File metadata

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

File hashes

Hashes for prefligit-0.0.16.tar.gz
Algorithm Hash digest
SHA256 be658a7fee1643f0f38eba815bc9b608b537f4daa3e046c85443456516d818fc
MD5 a40a4da2f0cb3fe86932631fed45eece
BLAKE2b-256 55378cd30a123e89b0cf8c6d19d233da9e02ac7dba9fd07e1a880537b7840e20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prefligit-0.0.16-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1aea04af61244d72d8ac9439154f0368d4a0b4b9cea9ab1242358dc8ea5f3fb1
MD5 eb942c49f9e6836abc95293efc67f270
BLAKE2b-256 13f6312a7f19a4799cf1705aebfcd720bc98f7de7c87d78667338e9b4f249d61

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prefligit-0.0.16-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8bd5f54b6b9a2d30496b11f1044d54e3991a1fd8360bd94b99365b275df6f727
MD5 5ed69bc48af85a814a682c704b52dc95
BLAKE2b-256 40c8751aa2e10ae9f32f6eebb325cf6e639d4abbd17635ffd7be8edafb7e77d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prefligit-0.0.16-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8ae71399b8a35aa484be7eb1810fee27b928716c3745abd2815653aeddbbd465
MD5 68ede0fbbce448b41693b838a8e15aad
BLAKE2b-256 a5a096b13c8d22a54e8c7d6f6d5bb8d757745a984667da69292f289a5f53ddc8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prefligit-0.0.16-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d38ce8e1d4aac03c2a9a246dfbba13261801cf5e189622b409dc46bfe024612e
MD5 e612f7c5124da2a7f2a9b5aa35580475
BLAKE2b-256 941d67b6c492a5ccdcb3c40a0599accdb7bd2f69260309c1e94b1925c4f3c15b

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