Add black wrapper

Some system roles want not to run black on their code. This wrapper
decides whether to run black or not depending on content of config.sh.
This wrapper also allows to set patterns of files and directories via
config.sh to be processed or skipped by black.
This commit is contained in:
Jiri Kucera 2020-01-13 11:57:13 +01:00
parent 984eb0d60e
commit 2c79fad96f
3 changed files with 83 additions and 1 deletions

View file

@ -126,10 +126,13 @@ commands =
[testenv:black]
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:3.6}
basepython = python3.6
passenv = RUN_BLACK_*
deps =
black
whitelist_externals =
{[base]whitelist_externals}
commands =
black --check --diff --include "^[^.].*\.py$" --exclude "/(\.[^.].*|tests/roles)/" .
bash {toxinidir}/.travis/runblack.sh {envpython} --check --diff .
[testenv:pylint]
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:2.7}