Prefligit is a tool to manage and run Git hooks efficiently, helping enforce code quality and commit standards. It’s a clone of the popular precommit project, but refactored in Rust for better performance and reliability.
π§© My Contribution: Script Language Support for Prefligit Hooks #
The goal of this contribution was to enhance Prefligit by allowing users to define and run custom scripts as Git hooks, such as pre-commit and commit-msg. I worked on adding the “script” language support for these hooks.
I contributed to the Prefligit repository by adding script language support for hook scripts:
π Pull Request: #252 β feat(script): add script hooks support to prefligit
π Related issue: #45 β Support for script hooks
π Status: Merged and Closed
π§ What I Implemented #
- Added the ability to run scripts as hooks, e.g. for git hooks like pre-commit and commit-msg.
- Supported testing with sample scripts including:
- Precommit trailing spaces check
- Commit-msg conventional commit verb validation (feat, misc, etc.)
- Provided example test repository: precommit-hooks-test
π‘ Why It Matters #
- π οΈ Extends Prefligitβs flexibility by allowing custom scripting in hooks.
- π Helps teams enforce commit standards and code hygiene automatically.
π See my other contributions: github.com/Assstra