Skip to content

Commit 469787d

Browse files
committed
Add lint with bandit in CI
1 parent 5e5b009 commit 469787d

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,16 @@ jobs:
3737
sudo apt-get install gettext aspell aspell-fr enchant
3838
python -m pip install --upgrade pip
3939
pip install -r requirements.txt
40-
pip install flake8 pylint pytest coverage pytest-cov
40+
pip install bandit coverage flake8 pylint pytest pytest-cov
4141
4242
- name: Lint with flake8
4343
run: make flake8
4444

4545
- name: Lint with pylint
4646
run: make pylint
4747

48+
- name: Lint with bandit
49+
run: make bandit
50+
4851
- name: Test with pytest
4952
run: make test

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Drop Python 2 support, Python 3.6 is now required.
66
- Add support for Chinese full-stop.
7+
- Add lint with bandit in CI.
78

89
## Version 3.1 (2020-03-07)
910

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ all: check
2121

2222
check: lint test
2323

24-
lint: flake8 pylint
24+
lint: flake8 pylint bandit
2525

2626
flake8:
2727
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
@@ -31,5 +31,8 @@ pylint:
3131
pylint --disable=W0511,R0205 msgcheck
3232
pylint --disable=W0511,R0205 tests
3333

34+
bandit:
35+
bandit -r msgcheck
36+
3437
test:
3538
pytest -vv --cov-report term-missing --cov=msgcheck tests

msgcheck/po.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from codecs import escape_decode
2626
import os
2727
import re
28-
import subprocess
28+
import subprocess # nosec
2929
import tempfile
3030

3131
# enchant module is optional, spelling is checked on demand
@@ -461,7 +461,7 @@ def compile(self):
461461
"""
462462
output = ''
463463
try:
464-
output = subprocess.check_output(
464+
output = subprocess.check_output( # nosec
465465
['msgfmt', '-c', '-o', '/dev/null', self.filename],
466466
stderr=subprocess.STDOUT)
467467
except subprocess.CalledProcessError as exc:

0 commit comments

Comments
 (0)