From 908ea34f5566da8dc5ee3dbfa138ccfc8d905b68 Mon Sep 17 00:00:00 2001 From: Nikolai R Kristiansen Date: Mon, 15 Aug 2022 12:14:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Lint=20on=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/lint.yml | 4 ++++ tox.ini | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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