4438b8fd55
This commit enables the check of new pylint/pep8 violations. PYLINT - All convention related checks, except: - missing-class-docstring - missing-function-docstring - missing-module-docstring - consider-using-f-string - invalid-name - import-outside-toplevel - too-many-lines - consider-iterating-dictionary - unnecessary-lambda-assignment PEP8: - E117: over-indented - E123: closing bracket does not match indentation of opening bracket's line - E125: continuation line with the same indent as the next logical line - E305: expected 2 blank lines after class or function definition - E402: module level import not at top of file - E501: line too long - H216: flag use of third party mock Test Plan: 1. Perform `tox` command - Pass in py39, pylint, pep8 Closes-bug: 2033294 Change-Id: I635df8e809905cff582bd9d5eb57b91133560cf9 Signed-off-by: Hugo Brito <hugo.brito@windriver.com>
97 lines
2.4 KiB
INI
97 lines
2.4 KiB
INI
[tox]
|
|
envlist = py39,pep8,pylint
|
|
minversion = 2.3
|
|
skipsdist = True
|
|
|
|
# move tox work directory out of the source tree
|
|
toxworkdir = /tmp/{env:USER}_dctox
|
|
|
|
[dc]
|
|
stx_config_dir = ../../config
|
|
stx_fault_dir = ../../fault
|
|
|
|
cgcs_patch_src_dir = ../../update/sw-patch/cgcs-patch
|
|
cgtsclient_src_dir = {[dc]stx_config_dir}/sysinv/cgts-client/cgts-client
|
|
fmclient_src_dir = {[dc]stx_fault_dir}/python-fmclient/fmclient
|
|
fm_api_src_dir = {[dc]stx_fault_dir}/fm-api/source
|
|
nfv_client_src_dir = ../../nfv/nfv/nfv-client
|
|
tsconfig_src_dir = {[dc]stx_config_dir}/tsconfig/tsconfig
|
|
|
|
[testenv]
|
|
basepython = python3.9
|
|
sitepackages = False
|
|
install_command = pip install -v -v -v \
|
|
-c https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt \
|
|
{opts} {packages}
|
|
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
OS_STDOUT_CAPTURE=1
|
|
OS_STDERR_CAPTURE=1
|
|
OS_TEST_TIMEOUT=60
|
|
CURRENT_CFG_FILE={toxinidir}/.current.cfg
|
|
SINGLE_REPO=True
|
|
OSLO_LOCK_PATH={toxinidir}
|
|
|
|
deps =
|
|
-r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/requirements.txt
|
|
-e{[dc]cgcs_patch_src_dir}
|
|
-e{[dc]cgtsclient_src_dir}
|
|
-e{[dc]fmclient_src_dir}
|
|
-e{[dc]fm_api_src_dir}
|
|
-e{[dc]nfv_client_src_dir}
|
|
-e{[dc]tsconfig_src_dir}
|
|
|
|
allowlist_externals =
|
|
rm
|
|
find
|
|
|
|
[testenv:py39]
|
|
commands =
|
|
find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete
|
|
python setup.py testr --slowest --testr-args='{posargs}'
|
|
|
|
|
|
[testenv:pep8]
|
|
commands = flake8
|
|
|
|
[testenv:cover]
|
|
commands =
|
|
coverage erase
|
|
rm -Rf cover
|
|
rm -f coverage.xml
|
|
find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete
|
|
python setup.py testr --coverage --testr-args='{posargs}'
|
|
coverage html -d cover
|
|
coverage xml --rcfile=.coveragerc_xml
|
|
coverage report
|
|
|
|
[testenv:debug]
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
[flake8]
|
|
show-source = True
|
|
max-line-length = 85
|
|
# Suppressed flake8 codes
|
|
# W503 line break before binary operator
|
|
# W504 line break after binary operator
|
|
# W605 invalid escape sequence
|
|
# E731 do not assign a lambda expression, use a def
|
|
ignore = W503,W504,W605,E731
|
|
builtins = _
|
|
|
|
[testenv:genconfig]
|
|
commands =
|
|
oslo-config-generator --config-file=tools/config-generator.conf
|
|
|
|
[hacking]
|
|
import_exceptions = dcmanager.common.i18n,dcorch.common.i18n
|
|
|
|
[testenv:pylint]
|
|
setenv =
|
|
{[testenv]setenv}
|
|
PYTHONPATH = {toxinidir}
|
|
commands =
|
|
pylint {posargs} dccommon dcdbsync dcmanager dcorch --rcfile=./.pylintrc
|