Browse Source

Wrap black with script that skips it if Python version < 3.6.

end-to-end-database-tests
Dan Helfman 3 years ago
parent
commit
1ab44d4201
  1. 13
      scripts/black
  2. 3
      tox.ini

13
scripts/black

@ -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

@ -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…
Cancel
Save