Skip to main content

Feat: Added Script Language Support for Prefligit Hooks

·197 words·1 min
Adrien Raimbault
Author
Adrien Raimbault

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