Lindley Werner c93f1aa754 Adding pylint to /virtualbox/pybox
Enabling automatic pylint with tox and zull for each new patchset.

Test plan:
PASS: Run "tox -e pylint" in the terminal, this will:
  - Run pylint in all python files
  - Show the report

Story: 2005051
Task: 47900
Change-Id: I2f66a5f72e3f8746c00aae96287ad3e4edb88e28
Signed-off-by: Lindley Werner <lindley.vieira@encora.com>
2023-06-30 12:12:01 -03:00

43 lines
1.3 KiB
INI

[tox]
envlist = linters,pylint
minversion = 2.3
skipsdist = True
[testenv]
deps = -r{toxinidir}/requirements/test-requirements.txt
allowlist_externals = reno
[testenv:linters]
basepython = python3
# bashate ignore:
# E006 - accept long lines
# E040 - false positive on |& syntax (new in bash 4)
allowlist_externals = bash
commands =
bash -c "find {toxinidir} \
\( -name .tox -prune \) \
-o -type f -name '*.yaml' \
-not \( -type f -path *template* -prune \) \
-print0 | xargs -0 yamllint"
bash -c "find {toxinidir} \
-not \( -type d -name .?\* -prune \) \
-type f \
-not -name \*~ \
-not -name \*.md \
-name \*.sh \
-print0 | xargs -0 bashate -v -iE006,E040"
[testenv:pylint]
basepython = python3
sitepackages = False
setenv =
BASEPATH = {toxinidir}/virtualbox/pybox
PYTHONPATH= {env:BASEPATH}:{env:BASEPATH}/helper:{env:BASEPATH}/consts:{env:BASEPATH}/utils
deps =
-r{env:BASEPATH}/requirements.txt
{[testenv]deps}
allowlist_externals = pylint
commands =
pylint {posargs} --rcfile=./pylint.rc virtualbox/pybox