Add bandit and flake8 lint run as separate testenv in tox.ini;

uncomment fail fast in test.sh and possibly remove --exit-zero bandit arg
when ready.
This commit is contained in:
Lee Miller 2022-04-05 01:34:35 +03:00
parent b92a78cb46
commit ace9bd7b49
Signed by untrusted user: lee.miller
GPG Key ID: 4F97A5EA88F4AB63
3 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,4 @@
#!/bin/sh #!/bin/sh
tox -e lint-basic # || exit 1
tox tox

View File

@ -8,6 +8,7 @@ max-line-length = 119
[flake8] [flake8]
max-line-length = 119 max-line-length = 119
exclude = bitmessagecli.py,bitmessagecurses,bitmessageqt,plugins,tests,umsgpack
ignore = E722,F841,W503 ignore = E722,F841,W503
# E722: pylint is preferred for bare-except # E722: pylint is preferred for bare-except
# F841: pylint is preferred for unused-variable # F841: pylint is preferred for unused-variable

10
tox.ini
View File

@ -12,6 +12,16 @@ commands =
coverage run -a src/bitmessagemain.py -t coverage run -a src/bitmessagemain.py -t
coverage run -a -m tests coverage run -a -m tests
[testenv:lint-basic]
deps =
bandit
flake8
commands =
bandit -r --exit-zero -s B105,B301,B411,B413,B608 \
-x checkdeps.*,bitmessagecurses,bitmessageqt,tests pybitmessage
flake8 pybitmessage --count --select=E9,F63,F7,F82 \
--show-source --statistics
[testenv:py27-doc] [testenv:py27-doc]
deps = deps =
.[docs] .[docs]