Wrap black with script that skips it if Python version < 3.6.
This commit is contained in:
parent
71b1c3dfb0
commit
1ab44d4201
2 changed files with 15 additions and 1 deletions
13
scripts/black
Executable file
13
scripts/black
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
python_version=$(python --version)
|
||||
|
||||
if [[ "$python_version" =~ "Python 3.5." ]]; then
|
||||
echo "Skipping black due to lack of support for $python_version."
|
||||
elif [[ "$python_version" =~ "Python 3.4." ]]; then
|
||||
echo "Skipping black due to lack of support for $python_version."
|
||||
else
|
||||
black --skip-string-normalization --line-length 100 --check .
|
||||
fi
|
3
tox.ini
3
tox.ini
|
@ -5,10 +5,11 @@ skipsdist = True
|
|||
[testenv]
|
||||
usedevelop = True
|
||||
deps = -rtest_requirements.txt
|
||||
whitelist_externals = bash
|
||||
commands =
|
||||
py.test --cov-report term-missing:skip-covered --cov=borgmatic --ignore=tests/end-to-end \
|
||||
tests []
|
||||
- black --skip-string-normalization --line-length 100 --check .
|
||||
bash scripts/black
|
||||
flake8 .
|
||||
|
||||
[testenv:black]
|
||||
|
|
Loading…
Reference in a new issue