From 6f5daa0c38b42d6c2e7b8e056dfd386ba1757f8a Mon Sep 17 00:00:00 2001 From: decentral1se Date: Mon, 25 Nov 2019 17:20:34 +0100 Subject: [PATCH] Configuration tweaks fox tox/travis to use and check Black --- .travis.yml | 2 ++ setup.cfg | 8 +++++++- tox.ini | 15 +++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ece3ead2..f44e6cfb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,8 @@ matrix: env: TOXENV=py27 - python: 2.7 env: TOXENV=lint + - python: 3.6 + env: TOXENV=format-check - python: 2.7 env: TOXENV=docs diff --git a/setup.cfg b/setup.cfg index db1dde69..71be731f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,8 @@ [flake8] -ignore = E501,E128,E731,E722 +ignore = + E501, + E128, + E731, + E722, + W503 # Black formatter conflict + E203 # Black formatter conflict diff --git a/tox.ini b/tox.ini index feeb4faa..85021c0d 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,21 @@ deps = flake8 skip_install = True usedevelop = False + +[testenv:format] +basepython = python3 +commands = black {posargs} moulinette test +deps = black +skip_install = True +usedevelop = False + +[testenv:format-check] +basepython = {[testenv:format]basepython} +commands = black {posargs:--check --diff} moulinette test +deps = {[testenv:format]deps} +skip_install = {[testenv:format]skip_install} +usedevelop = {[testenv:format]usedevelop} + [testenv:docs] usedevelop = True commands = python -m sphinx -W doc/ doc/_build