Skip to content

Commit 9a97585

Browse files
authored
Merge pull request #3 from ericwb/error_code
Add regex to get error code from bandit output
2 parents e17e85b + 180a7cf commit 9a97585

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

linter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Bandit(PythonLinter):
2323
version_re = r'^bandit\s(?P<version>\d+.\d+.\d+)'
2424
version_requirement = '>= 1.3.0'
2525
regex = (
26-
r'^>>\sIssue:\s\[.+\]\s(?P<message>.+)$\r?\n'
26+
r'^>>\sIssue:\s\[(?P<code>[B]\d+):.+\]\s(?P<message>.+)$\r?\n'
2727
r'^.*Severity:\s(?:(?P<error>High)|(?P<warning>(Medium|Low))).*$\r?\n'
2828
r'^.*Location:.*:(?P<line>\d+)$\r?\n'
2929
)

0 commit comments

Comments
 (0)