This repository contains some skeleton code to configure and run essential development tools for Python project via pre-commit hooks. It is an accompanying resource for my blog post 'Essential developer tools for improving your Python code' on Medium.
It includes hooks for:
Steps for running the pre-commit hooks:
- Clone this repository:
git clone https://github.com/ChrisCalculus/developer-tools.git
- Install requirements:
pip install -r requirements.txt
- Install pre-commit hooks
pre-commit install
andpre-commit install --hook-type pre-push
- Change some code and commit to your own repository (triggering the pre-commit hooks)
Notes:
- By default the development tools are not installed locally via pip, but fetched & cached when running the pre-commit hooks for the first time.
- Alternatively, you can install the development tools locally and run the pre-commit hooks using local packages by:
- Installing local packages:
pip install -r requirements-dev.txt
. - Rename
.pre-commit-config.local.yaml
to.pre-commit-config.yaml
- Install pre-commit hooks
pre-commit install
- Installing local packages: