Skip to main content

Better `pre-commit`, re-engineered in Rust

Project description

prefligit

Development Status CI GitHub downloads

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, node, 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.17/prefligit-installer.sh | sh

# On Windows
powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prefligit/releases/download/v0.0.17/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.17.tar.gz (133.1 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.17-py3-none-win_amd64.whl (4.2 MB view details)

Uploaded Python 3Windows x86-64

prefligit-0.0.17-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

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

Uploaded Python 3macOS 11.0+ ARM64

prefligit-0.0.17-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.17.tar.gz.

File metadata

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

File hashes

Hashes for prefligit-0.0.17.tar.gz
Algorithm Hash digest
SHA256 d60c2b4bcf5bb252aca07b9eaa6e7d0f1e68e6e9ca1489089f13caa6fba1f7c4
MD5 dbdbb393f7d2c3b3cad6d097e28c31dc
BLAKE2b-256 65b1a9c3b752146ebf2c168e008b0a14ffd120ccc5fb70b979b3abe3e38e45f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prefligit-0.0.17-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f3db259d5d1f6a4d4962de19e15fb57103a61942c834c0519cdae05c02c9faa2
MD5 18a5891c266b61b716192a91dc854c4e
BLAKE2b-256 00bb7b262f37731f250b796c81f5c0c0bb67aca7a2b32718d16eeb7b9a483a33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prefligit-0.0.17-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 69ca799204e6b6d7748e577ff82d082c73d296cfa854315068d0b0d004b7058e
MD5 e1bbdeff8f2d74a89a0e9d3a59d69a08
BLAKE2b-256 ac5bf48e07d0b7388aec43454bf42d28eae5073ade3fcb09d62ab6d9275cdd68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prefligit-0.0.17-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ac323287cc175f8b921c0aa37fa87e2e5980802c168e5fdfebba4f4e961219b7
MD5 9a118e951cef473a0515daa29d062803
BLAKE2b-256 01beee9da792a9faaff77c77fcbc758ef777a1821db37ff2b95f7c06cf49c5a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prefligit-0.0.17-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 87dd7a061bdffc43064e3efca4d9b17a6839d11164fd0b731a51b32a611e9107
MD5 d4d262170a6f4b92b8a69ef7ab3d3877
BLAKE2b-256 9dd8bda9376841f2d652fa5fd29059ffd60c6a84f777f872014ea163e7d1bc0d

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