2016-10-13 15:33:00 +00:00
|
|
|
[tox]
|
2017-09-28 10:15:50 +00:00
|
|
|
envlist = config,flake8,bashate
|
2016-10-13 15:33:00 +00:00
|
|
|
skipsdist = True
|
|
|
|
|
2017-09-28 10:15:50 +00:00
|
|
|
[testenv]
|
|
|
|
whitelist_externals =
|
|
|
|
bash
|
|
|
|
|
2016-10-13 15:33:00 +00:00
|
|
|
[testenv:config]
|
|
|
|
commands =
|
|
|
|
/bin/bash -c 'set -euo pipefail && . ./conf/production.env.example'
|
|
|
|
/bin/bash -c 'set -euo pipefail && . ./conf/development.env.example'
|
|
|
|
|
2017-09-28 10:15:50 +00:00
|
|
|
[testenv:bashate]
|
|
|
|
deps = bashate==0.5.1
|
|
|
|
commands =
|
|
|
|
# Run bashate check for all bash scripts
|
|
|
|
# Ignores the following rules:
|
|
|
|
# E003: Indent not multiple of 4 (we use multiples of 2)
|
|
|
|
# E006: Line longer than 79 columns
|
|
|
|
bash -c "grep --recursive --binary-files=without-match \
|
|
|
|
--files-with-match '^.!.*\(ba\)\?sh$' \
|
|
|
|
--exclude-dir .tox \
|
|
|
|
--exclude-dir .git \
|
|
|
|
{toxinidir} | xargs bashate --error . --verbose --ignore=E003,E006"
|
|
|
|
|
2016-10-13 15:33:00 +00:00
|
|
|
[testenv:flake8]
|
|
|
|
deps =
|
|
|
|
flake8
|
|
|
|
flake8-debugger
|
|
|
|
commands = flake8 {posargs}
|
|
|
|
|
2017-09-14 10:15:26 +00:00
|
|
|
[testenv:isort]
|
|
|
|
deps = isort==4.2.15
|
|
|
|
commands =
|
|
|
|
bash -c "find {toxinidir} \
|
|
|
|
-type d \
|
|
|
|
\( \
|
|
|
|
-path {toxinidir}/.git -o \
|
|
|
|
-path {toxinidir}/.tox -o \
|
|
|
|
-path {toxinidir}/.venv -o \
|
|
|
|
-path {toxinidir}/plugins -o \
|
|
|
|
-path {toxinidir}/node_modules \
|
|
|
|
\) -prune -o \
|
|
|
|
-name '*.py' \
|
|
|
|
-print | xargs isort {posargs:--check-only} --verbose"
|
|
|
|
|
2016-10-13 15:33:00 +00:00
|
|
|
[flake8]
|
2017-06-01 10:08:51 +00:00
|
|
|
exclude = .venv,venv,.tox,dist,doc,build,*.egg,docs,setup.py,*/migrations/
|
2017-11-09 15:01:38 +00:00
|
|
|
ignore = E121,E123,E125,E126,E127,E128,E131,E222,E226,E231,E251,E261,E265,E302,E305,E402,E714,E722,F401,F403,F405,F841,W391
|
2016-10-13 15:33:00 +00:00
|
|
|
max-line-length = 160
|
|
|
|
# E121 continuation line under-indented for hanging indent
|
|
|
|
# E123 closing bracket does not match indentation of opening bracket's line
|
|
|
|
# E125 continuation line with same indent as next logical line
|
|
|
|
# E126 continuation line over-indented for hanging indent
|
|
|
|
# E127 continuation line over-indented for visual indent
|
|
|
|
# E128 continuation line under-indented for visual indent
|
|
|
|
# E131 continuation line unaligned for hanging indent
|
|
|
|
# E222 multiple spaces after operator
|
|
|
|
# E226 missing whitespace around arithmetic operator
|
|
|
|
# E231 missing whitespace after
|
|
|
|
# E251 unexpected spaces around keyword / parameter equals
|
|
|
|
# E261 at least two spaces before inline comment
|
|
|
|
# E265 block comment should start with '# '
|
|
|
|
# E302 expected 2 blank lines, found 1
|
|
|
|
# E305 expected 2 blank lines after class or function definition, found 1
|
|
|
|
# E402 module level import not at top of file
|
|
|
|
# E714 test for object identity should be 'is not'
|
2017-11-09 15:01:38 +00:00
|
|
|
# E722 do not use bare except
|
2016-10-13 15:33:00 +00:00
|
|
|
# F401 Imported but unused
|
|
|
|
# F403 'from module import *' used; unable to detect undefined names
|
|
|
|
# F405 foo may be undefined, or defined from star imports
|
|
|
|
# F841 local variable 'foo' is assigned to but never used
|
|
|
|
# W391 blank line at end of file
|