From ace9bd7b49b25243e1ecd0f58983775d80de80d7 Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Tue, 5 Apr 2022 01:34:35 +0300 Subject: [PATCH] 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. --- .buildbot/tox/test.sh | 1 + setup.cfg | 1 + tox.ini | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/.buildbot/tox/test.sh b/.buildbot/tox/test.sh index f57f61e5..8b994fd4 100755 --- a/.buildbot/tox/test.sh +++ b/.buildbot/tox/test.sh @@ -1,3 +1,4 @@ #!/bin/sh +tox -e lint-basic # || exit 1 tox diff --git a/setup.cfg b/setup.cfg index a4e0547c..28ceaede 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,6 +8,7 @@ max-line-length = 119 [flake8] max-line-length = 119 +exclude = bitmessagecli.py,bitmessagecurses,bitmessageqt,plugins,tests,umsgpack ignore = E722,F841,W503 # E722: pylint is preferred for bare-except # F841: pylint is preferred for unused-variable diff --git a/tox.ini b/tox.ini index 632c7381..bbea28df 100644 --- a/tox.ini +++ b/tox.ini @@ -12,6 +12,16 @@ commands = coverage run -a src/bitmessagemain.py -t 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] deps = .[docs]