Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

python-githooks

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

python-githooks

Create git hooks with ease using a simple configuration file in a git project

  • 1.0.7
  • PyPI
  • Socket score

Maintainers
1

python-githooks

code linting: flake8 code quality: pytest MIT license CircleCI

Create git hooks with ease using a simple configuration file in a git project

Install

pip install python-githooks

Usage

  1. Create a .githooks.ini configuration file(If not provided a dummy configuration file will be created).
  2. Add sections based on git hooks names followed by a command property with the shell code you want to run.
  3. Run either python -m python_githooks or githooks in you virtual environment.
  • Configuration file Example:
# .githooks.ini

[pre-commit]
command = pytest --cov

[pre-push]
command = pytest --cov && flake8
  • Remember to re-run python -m python_githooks or githooks every time you make changes to the configuration file, whether it is for adding new hooks or modifying the current ones.

Removing a hook

If you already created a hook and now want to remove it, just set the command value to empty, like this:

# .githooks.ini

[pre-commit]
command = 

This will not actually physically remove the hook from the git local project, just will make it instantly exit with 0 status code.

License

python-githooks is MIT-licensed.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc