diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 08aa276..021d38b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,8 +1,14 @@ default_language_version: python: python3.10 + repos: - repo: https://github.com/PyCQA/flake8 rev: 5.0.4 hooks: - id: flake8 additional_dependencies: [flake8-bugbear==22.7.1] + +- repo: https://github.com/psf/black + rev: 22.6.0 + hooks: + - id: black diff --git a/Makefile b/Makefile index b850ae8..8f7ea0d 100644 --- a/Makefile +++ b/Makefile @@ -14,11 +14,7 @@ test: tests # Alias test -> tests .PHONY: format format: - black --exclude "/migrations/" graphene_django examples setup.py - -.PHONY: lint -lint: - flake8 graphene_django examples + pre-commit run --all-files .PHONY: docs ## Generate docs docs: dev-setup diff --git a/setup.py b/setup.py index 9743328..cadf970 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ tests_require = [ dev_requires = [ - "black==19.10b0", + "black==22.6.0", "flake8>=5,<6", "flake8-black==0.3.3", "flake8-bugbear==22.7.1", diff --git a/tox.ini b/tox.ini index afe79c6..952ba68 100644 --- a/tox.ini +++ b/tox.ini @@ -39,12 +39,6 @@ deps = djangomaster: https://github.com/django/django/archive/master.zip commands = {posargs:py.test --cov=graphene_django graphene_django examples} -[testenv:black] -basepython = python3.10 -deps = -e.[dev] -commands = - black --exclude "/migrations/" graphene_django examples setup.py --check - [testenv:pre-commit] basepython = python3.10 skip_install = true