[tooling] Add pre-commit hooks using LeftHook#265
[tooling] Add pre-commit hooks using LeftHook#265jovnc wants to merge 2 commits intogit-mastery:mainfrom
Conversation
|
Hi @jovnc, thank you for your contribution! 🎉 This PR comes from your fork Before you request for a review, please ensure that you have tested your changes locally! Important The previously recommended way of using Please read the following instructions for the latest instructions. PrerequisitesEnsure that you have the Testing stepsIf you already have a local Git-Mastery root to test, you can skip the following step. Create a Git-Mastery root locally: gitmastery setupNavigate into the Git-Mastery root (defaults to cd gitmastery-exercises/Edit the {
# other fields...
"exercises_source": {
"username": "jovnc",
"repository": "exercises",
"branch": "feat/left-hook"
}
}Then, you can use the gitmastery download <your new change>
gitmastery verifyChecklist
Important To any reviewers of this pull request, please use the same instructions above to test the changes. |
There was a problem hiding this comment.
Pull request overview
This PR adds pre-commit hooks using LeftHook to automatically run linting and type checking before commits. The implementation integrates with the existing CI tooling (ruff and mypy) to catch issues earlier in the development cycle.
Changes:
- Added lefthook as a developer dependency
- Modified setup script to install git hooks after dependency installation
- Created lefthook configuration for pre-commit hooks (ruff linting, formatting, and mypy type checking)
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| requirements.txt | Added lefthook package to developer tooling dependencies |
| setup.sh | Added conditional logic to install lefthook git hooks after pip install |
| lefthook.yml | Configured pre-commit hooks for ruff-lint, ruff-format, and mypy on Python files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes git-mastery/git-mastery#66
As per RFC: https://docs.google.com/document/d/1LU8oDc19Lm_51v_g7iodC6a6Ze44k6lG5-gQ55AttBg/edit?tab=t.0