Skip to content

Commit 762903d

Browse files
authored
Install bandit. (#851)
1 parent 5d44e2f commit 762903d

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

pymodbus/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ def getDiagnostic(self, bit): # pylint: disable=invalid-name
599599
if bit and 0 <= bit < len(self.__diagnostic):
600600
return self.__diagnostic[bit]
601601
except Exception: # pylint: disable=broad-except
602-
pass
602+
return None
603603
return None
604604

605605
def getDiagnosticRegister(self): # pylint: disable=invalid-name

requirements-checks.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Python packages required to run `make check'.
2-
flake8 >= 2.6.0
3-
flake8-docstrings >= 0.2.8
4-
pyflakes >= 1.2.3
5-
pylint >= 2.13.3
6-
codespell >= 2.1.0
2+
flake8>=2.6.0
3+
flake8-docstrings>=0.2.8
4+
pyflakes>=1.2.3
5+
pylint>=2.13.3
6+
codespell>=2.1.0
7+
bandit>=1.7.4

tox.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ ignore_errors = false
3535
commands =
3636
codespell doc examples pymodbus test
3737

38+
[testenv:bandit]
39+
deps =
40+
-r requirements-checks.txt
41+
ignore_errors = false
42+
commands =
43+
bandit -r doc/ examples/ pymodbus/ test/
44+
3845
[testenv:flake8]
3946
deps = -r requirements-checks.txt
4047
commands =

0 commit comments

Comments
 (0)