- Install with
pip install pre-commitin your local dev environment. Even though I work in Docker environments, I still use a virtualenv so I don't need to rebuild a container every time I run pre-commit. - Add a
.pre-commit-config.yamlfile - Add the things you want linted to that config file
- The first time you run pre-commit, run
pre-commit run --all-filesif you want to lint your whole codebase at once - After that, run
pre-commit runand only the files you changed will be linted
- adamchainz/blacken-docs: Run `black` on python code blocks in documentation files
- https://github.com/psf/black
- https://github.com/pycqa/isort
- https://github.com/prettier/prettier
default_language_version:
python: python3.12
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort