cb0b2ffe1e
Flake8 currently ignores the following errors: H401: docstring should not start with a space H404: multi line docstring should start without a leading new line H405: multi line docstring summary not separated with an empty line Enable them for more consistent formatting of docstrings Change-Id: I385e28e9c6eca3c02a3def51ff64b00b7a63a853 Story: 2004515 Task: 30076 Signed-off-by: Eric Barrett <eric.barrett@windriver.com>
148 lines
4.3 KiB
INI
148 lines
4.3 KiB
INI
[tox]
|
|
envlist = linters
|
|
minversion = 2.3
|
|
skipsdist = True
|
|
stxdir = {toxinidir}/..
|
|
|
|
[testenv]
|
|
install_command = pip install -U {opts} {packages}
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
OS_STDOUT_CAPTURE=1
|
|
OS_STDERR_CAPTURE=1
|
|
OS_TEST_TIMEOUT=60
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
|
|
[testenv:linters]
|
|
basepython = python3
|
|
whitelist_externals = bash
|
|
#bashate ignore
|
|
#E006 Line too long
|
|
#E041 Arithmetic expansion using $[ is deprecated for $((
|
|
#E042 local declaration hides errors
|
|
#E043 Arithmetic compound has inconsistent return semantics
|
|
#E044 Use [[ for non-POSIX comparisions
|
|
commands =
|
|
bash -c "find {toxinidir} \
|
|
-not \( -type d -name .?\* -prune \) \
|
|
-type f \
|
|
-not -name \*~ \
|
|
-not -name \*.md \
|
|
-name \*.sh \
|
|
-print0 | xargs -n 1 -0 bashate -v \
|
|
-i E006,E041,E042,E043,E044 -e E*"
|
|
bash -c "find {toxinidir} \
|
|
\( -path {toxinidir}/.tox \) -a -prune \
|
|
-o -type f -name '*.yaml' \
|
|
-print0 | xargs -0 yamllint"
|
|
|
|
[flake8]
|
|
# E series are pep8
|
|
# E265 block comment should start with '# '
|
|
# E266 too many leading '#' for block comment
|
|
# E402 module level import not at top of file
|
|
# E501 line too long > 80
|
|
# E722 do not use bare except'
|
|
# H series are hacking
|
|
# H101: Use TODO(NAME)
|
|
# H102 is apache license
|
|
# H104: File contains nothing but comments
|
|
# H201: no 'except:' at least use 'except Exception:'
|
|
# H237: module exception is removed in Python 3
|
|
# H238: old style class declaration, use new style
|
|
# H306: imports not in alphabetical order
|
|
# W series
|
|
# W191 indentation contains tabs
|
|
# W291 trailing whitespace
|
|
# W391 blank line at end of file
|
|
# W503 line break before binary operator
|
|
# B series are from bugbear
|
|
# B001 Do not use bare `except:
|
|
# B007 Loop control variable 'cpu' not used within the loop body.
|
|
# B009 Do not call getattr with a constant attribute value
|
|
# B010 Do not call setattr with a constant attribute value
|
|
# B301 Python 3 does not include `.iter*` methods on dictionaries.
|
|
# F series
|
|
# F401 'module' imported but unused
|
|
ignore = E265,E266,E402,E501,E722
|
|
H101,H102,H104,H201,H238,H237,H306,
|
|
W191,W291,W391,W503,
|
|
B001,B007,B009,B010,B301,
|
|
F401
|
|
|
|
[testenv:pep8]
|
|
basepython = python3
|
|
usedevelop = False
|
|
skip_install = True
|
|
deps =
|
|
hacking
|
|
flake8-bugbear<=19.3.0
|
|
flake8<3.6.0
|
|
commands =
|
|
flake8
|
|
|
|
[testenv:pylint]
|
|
basepython = python2.7
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
-e{[tox]stxdir}/stx-update/tsconfig/tsconfig
|
|
-e{[tox]stxdir}/stx-fault/fm-api
|
|
-e{[tox]stxdir}/stx-config/sysinv/sysinv/sysinv
|
|
-e{[tox]stxdir}/stx-config/sysinv/cgts-client/cgts-client
|
|
docutils
|
|
keyring
|
|
libvirt-python
|
|
oslo_i18n
|
|
oslo_log
|
|
oslo_messaging
|
|
oslo_service
|
|
python-cephclient
|
|
python-cinderclient
|
|
python-glanceclient
|
|
python-keystoneclient
|
|
python-novaclient
|
|
SQLAlchemy
|
|
retrying
|
|
python-daemon==2.1.2
|
|
pylint
|
|
|
|
# There are currenrly 5 python modules with a setup.py file
|
|
commands = pylint --rcfile=./pylint.rc \
|
|
ceph/ceph-manager/ceph-manager/ceph_manager \
|
|
logging/logmgmt/logmgmt/logmgmt \
|
|
tools/storage-topology/storage-topology/storage_topology \
|
|
tools/vm-topology/vm-topology/vm_topology \
|
|
utilities/platform-util/platform-util/platform_util
|
|
|
|
[testenv:venv]
|
|
basepython = python3
|
|
commands = {posargs}
|
|
|
|
[testenv:docs]
|
|
basepython = python3
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
rm -rf doc/build
|
|
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
|
|
whitelist_externals = rm
|
|
|
|
[testenv:releasenotes]
|
|
basepython = python3
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
rm -rf releasenotes/build
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
whitelist_externals =
|
|
rm
|
|
reno
|
|
|
|
[testenv:newnote]
|
|
basepython = python3
|
|
# Re-use the releasenotes venv
|
|
envdir = {toxworkdir}/releasenotes
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
commands = reno new {posargs}
|
|
|
|
[testenv:functional]
|
|
basepython = python3
|
|
whitelist_externals = cat
|
|
commands = cat /etc/group
|