Docker image to run pre-commit on Python apps/libraries
Go to file
Benjamin Renard 195cca2df8 Add .yamllint.yml 2024-03-15 08:38:19 +01:00
fake_python_module Initial release 2023-01-19 14:43:06 +01:00
.gitignore Initial release 2023-01-19 14:43:06 +01:00
.pre-commit-config.yaml Introduce new hooks, upgrade existing and add wrapper script to call pylint 2024-02-13 13:18:44 +01:00
.pre-commit-pylint .pre-commit-pylint: auto install pylint in venv and poetry env if missing 2024-02-13 13:41:35 +01:00
.yamllint.yml Add .yamllint.yml 2024-03-15 08:38:19 +01:00
Dockerfile Dockerfile: set /src as git safe directory for root 2024-02-13 13:35:27 +01:00
README.md Update README file 2024-02-13 13:34:45 +01:00

README.md

Docker image to run pre-commit on Python apps/libraries

Debian stable based image with common dependencies to run pre-commit on Python apps/libraries:

  • common python packages: python3-all python3-dev python3-pip python3-venv pylint
  • build-essential to allow local python package using pip
  • pre-commit and git commands
  • pre-install pre-commit environments for ruff, pyupgrade, black, isort, flake8, codespell, yamllint, prettier, pylint and bandit.

To use it:

docker run \
    -it --rm \
    -v "$(pwd)":/src -w /src \
    brenard/python-pre-commit \
    pre-commit run --all-files

Note: an example .pre-commit-config.yaml file is provided with Docker image source. To test it on your project, use to following command:

docker run \
    -it --rm \
    -v "$(pwd)":/src -w /src \
    -v "$(pwd)/.pre-commit-config.yaml":/src/.pre-commit-config.yaml \
    brenard/python-pre-commit \
    pre-commit run --all-files