From 84d84973b02de5e697fed18867e0383615fbb088 Mon Sep 17 00:00:00 2001 From: Jonathan Willitts Date: Tue, 19 Nov 2024 16:10:17 +0000 Subject: [PATCH] Add pre-commit env/runner to Tox/GH Actions --- pyproject.toml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9dd4330..550ee42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,18 +38,19 @@ legacy_tox_ini = """ envlist = py{312,313}-dj{51,dev}, lint + pre-commit isolated_build = true [gh-actions] python = - 3.12: py312 - 3.13: py313, lint + 3.12: py312, lint, pre-commit + 3.13: py313 [gh-actions:env] DJANGO = 5.1: dj51 - dev: djdev, lint + dev: djdev, lint, pre-commit [testenv] deps = @@ -70,7 +71,19 @@ commands = [testenv:lint] deps = -r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/lint.txt commands = + python --version + pip --version + pip freeze isort --profile=black --check --diff . black --check --diff . flake8 . + +[testenv:pre-commit] +deps = pre-commit +commands = + python --version + pip --version + pip freeze + pre-commit autoupdate + pre-commit run --all-files """