pre-commit is a framework for managing and maintaining Git hooks. It allows you to automatically run checks (e.g., linting, formatting, commit message validation) before committing code.
- Install pre-commit framework with your system package manager, for instance, Arch's pacman:
sudo pacman -S pre-commit- Install hooks:
pre-commit install --hook-type commit-msgThis project uses the commit-msg hook from pre-commit, so all commit messages must follow these rules.
Commit messages should follow this pattern:
- feat — adding a new feature;
- fix — fixing a bug;
- refactor — refactoring code without changing logic;
- docs — updating documentation;
- style — formatting changes, no logic changes;
- test — adding or updating tests;
- chore — changes not affecting code (configs, build, etc.);
- perf — performance improvements.
✅ Correct:
feat(auth): added OAuth2.0 supportfix(notifications): fixed email sending issuedocs(readme): updated installation guiderefactor(core): optimized database queries
❌ Incorrect:
fixed bug(missing type)fix: fixed a bug(missing scope)Added a new feature(wrong format)
- The first line must not exceed 72 characters.
- If additional details are needed, add a blank line and write a more detailed description.