diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 559326c..6196101 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,3 +20,7 @@ jobs: run: tox env: TOXENV: flake8 + - name: Run pre-commit 💅 + run: tox + env: + TOXENV: pre-commit diff --git a/tox.ini b/tox.ini index d65839a..677d029 100644 --- a/tox.ini +++ b/tox.ini @@ -42,10 +42,16 @@ commands = {posargs:py.test --cov=graphene_django graphene_django examples} basepython = python3.9 deps = -e.[dev] commands = - black --exclude "/migrations/" graphene_django examples setup.py --check + black graphene_django examples setup.py --check [testenv:flake8] basepython = python3.9 deps = -e.[dev] commands = flake8 graphene_django examples setup.py + +[testenv:pre-commit] +skip_install = true +deps = pre-commit +commands = + pre-commit run --all-files --show-diff-on-failure