
This adds in flake8, bandit and pylint tox jobs for the report tool Test Plan: PASS: build-pkgs -c -p collector Story: 2010642 Task: 48265 Signed-off-by: Al Bailey <al.bailey@windriver.com> Change-Id: I81fcf500663e1f74f491e11c25ff1d427d456536
63 lines
1.6 KiB
INI
63 lines
1.6 KiB
INI
[tox]
|
|
envlist = pep8,pylint,bandit
|
|
minversion = 2.3
|
|
skipsdist = True
|
|
stxdir = {toxinidir}/../..
|
|
|
|
[testenv]
|
|
allowlist_externals = find
|
|
sh
|
|
basepython = python3
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
|
|
install_command = pip install \
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
|
|
{opts} {packages}
|
|
|
|
passenv =
|
|
XDG_CACHE_HOME
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
LANG=en_US.UTF-8
|
|
LANGUAGE=en_US:en
|
|
LC_ALL=C
|
|
OS_STDERR_CAPTURE=1
|
|
OS_STDOUT_CAPTURE=1
|
|
OS_TEST_TIMEOUT=60
|
|
PYTHONDONTWRITEBYTECODE=True
|
|
PYTHONHASHSEED=0
|
|
sitepackages = False
|
|
usedevelop = False
|
|
|
|
[bandit]
|
|
# The following bandit errors are suppressed
|
|
# B404:blacklist (import-subprocess)
|
|
# B602:subprocess_popen_with_shell_equals_true
|
|
# B603:subprocess_without_shell_equals_true
|
|
# B607:start_process_with_partial_path
|
|
# B608:hardcoded_sql_expressions
|
|
skips = B404,B602,B603,B607,B608
|
|
|
|
[testenv:bandit]
|
|
commands = bandit --ini tox.ini -n 5 -r report
|
|
|
|
[flake8]
|
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,release-tag-*
|
|
max-line-length = 80
|
|
show-source = True
|
|
ignore =
|
|
H101, # Use TODO(NAME)
|
|
H405, # multi line docstring summary not separated with an empty line
|
|
W504, # line break after binary operator
|
|
E226, # missing whitespace around arithmetic operator
|
|
F841, # local variable is assigned to but never used
|
|
|
|
[testenv:flake8]
|
|
commands = flake8 {posargs}
|
|
|
|
[testenv:pep8]
|
|
commands = flake8 {posargs}
|
|
|
|
[testenv:pylint]
|
|
commands = pylint report --rcfile=./pylint.rc
|