feat: added vulture in precommit
What does this MR do and why?
- Integrates Vulture (dead code detection tool) into the project using pre-commit hooks
- Automatically scans for unused code (functions, variables, imports) before every commit
- Configured with a minimum confidence threshold to reduce false positives
- Excludes common directories like tests and migrations
Why:
- Improves code quality and maintainability
- Prevents dead/unused code from being committed
- Helps keep the codebase clean and optimized
References
- Vulture documentation: https://github.com/jendrikseipp/vulture
- Pre-commit documentation: https://pre-commit.com/
Screenshots or screen recordings
| Before | After |
|---|---|
| No dead code check before commit | Vulture runs automatically and flags unused code before commit |
How to set up and validate locally
-
Install dependencies
pip install vulture pre-commit -
Install pre-commit hooks
pre-commit install -
Run pre-commit manually (optional)
pre-commit run --all-files -
Make a commit
- Vulture will automatically run and detect unused code
- If issues are found, commit will be blocked until fixed
MR acceptance checklist
-
Code follows project conventions -
No breaking changes introduced -
Pre-commit hook works as expected -
Vulture correctly detects unused code -
Documentation updated (if required)