Run black on the CI with --check option

This commit is contained in:
Bruno Alla 2019-03-11 22:00:02 +00:00
parent f3c82aaf60
commit 87ea2c33cc
3 changed files with 11 additions and 2 deletions

View File

@ -13,8 +13,10 @@ before_install:
matrix: matrix:
include: include:
- name: Tox test - name: Test
script: tox -e py36 script: tox -e py36
- name: Black
script: tox -e black
- name: Basic Docker - name: Basic Docker
script: sh tests/test_docker.sh script: sh tests/test_docker.sh
- name: Docker with Celery - name: Docker with Celery

View File

@ -19,6 +19,9 @@ cd my_awesome_project
# run the project's type checks # run the project's type checks
docker-compose -f local.yml run django mypy my_awesome_project docker-compose -f local.yml run django mypy my_awesome_project
# Run black with --check option
docker-compose -f local.yml run django black --check my_awesome_project
# run the project's tests # run the project's tests
docker-compose -f local.yml run django pytest docker-compose -f local.yml run django pytest

View File

@ -1,7 +1,11 @@
[tox] [tox]
skipsdist = true skipsdist = true
envlist = py36 envlist = py36,black
[testenv] [testenv]
deps = -rrequirements.txt deps = -rrequirements.txt
commands = pytest {posargs:./tests} commands = pytest {posargs:./tests}
[testenv:black]
deps = black
commands = black --check hooks tests setup.py docs