7e19909172
This job adds a single linters tox target. The linters target is an aggregation of linters for this repo including: - bashate - flake8 Other linters such as yamllint can be added to this repo by later commits. Certain flake8 codes are suppressed. They can be enabled by later commits. This commit also adds basic contributing and hacking docs. Change-Id: Ib10d84141954f1d39a258913a98d314763c74824 Story: 2006166 Task: 36544 Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
56 lines
1.6 KiB
INI
56 lines
1.6 KiB
INI
[tox]
|
|
envlist = linters
|
|
minversion = 2.3
|
|
skipsdist = True
|
|
sitepackages=False
|
|
|
|
[testenv]
|
|
install_command = pip install -U {opts} {packages}
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
OS_STDOUT_CAPTURE=1
|
|
OS_STDERR_CAPTURE=1
|
|
OS_DEBUG=1
|
|
OS_LOG_CAPTURE=1
|
|
deps =
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
whitelist_externals =
|
|
bash
|
|
|
|
[testenv:bashate]
|
|
# Treat all E* codes as Errors rather than warnings using: -e 'E*'
|
|
commands =
|
|
bash -c "find {toxinidir} \
|
|
-not \( -type d -name .?\* -prune \) \
|
|
-type f \
|
|
-not -name \*~ \
|
|
-not -name \*.md \
|
|
-name \*.sh \
|
|
-print0 | xargs -r -n 1 -0 bashate -v \
|
|
-e 'E*'"
|
|
|
|
[flake8]
|
|
# Note: hacking pulls in flake8 2.5.5 which can not parse an ignore list spanning multiple lines
|
|
# F errors are high priority to fix. W are warnings. E series are pep8, H series are hacking
|
|
# F401 'FOO' imported but unused
|
|
# F841 local variable 'foo' is assigned to but never used
|
|
# W291 trailing whitespace
|
|
# E265 block comment should start with '# '
|
|
# H101 is TODO
|
|
# H104 File contains nothing but comments
|
|
# H201 no 'except:' at least use 'except Exception:'
|
|
# H238 old style class declaration, use new style (inherit from `object`)
|
|
# H306 imports not in alphabetical order (sys, re)
|
|
ignore=F401,F841,W291,E265,H101,H104,H201,H238,H306
|
|
max-line-length=110
|
|
|
|
[testenv:flake8]
|
|
commands =
|
|
flake8
|
|
|
|
[testenv:linters]
|
|
commands =
|
|
{[testenv:bashate]commands}
|
|
{[testenv:flake8]commands}
|