From 5afa4833209f139cff8f136e783ab9d2b5caef1c Mon Sep 17 00:00:00 2001 From: Release-Candidate Date: Tue, 9 Jul 2024 18:53:25 +0200 Subject: [PATCH] Make parser work with newer version of bandit --- linter.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/linter.py b/linter.py index 98c3840..fba68e9 100644 --- a/linter.py +++ b/linter.py @@ -2,16 +2,12 @@ class Bandit(PythonLinter): - cmd = ('bandit', '${args}', '-n', '1', '-f', 'txt', '-') + cmd = ("bandit", "${args}", "-n", "1", "-f", "txt", "-") regex = ( - r'^>>\sIssue:\s\[(?P[B]\d+):.+\]\s(?P.+)$\r?\n' - r'^.*Severity:\s(?:(?PHigh)|(?P(Medium|Low))).*$\r?\n' - r'^.*Location:.*:(?P\d+)$\r?\n' + r"^>>\sIssue:\s\[(?P[B]\d+):.+\]\s(?P.+)$\r?\n" + r"^.*Severity:\s(?:(?PHigh)|(?P(Medium|Low))).*$\r?\n" + r"(.*\r?\n)*^.*Location:.*?:(?P\d+)(:\d+)?$\r?\n" ) multiline = True error_stream = util.STREAM_BOTH - defaults = { - 'selector': 'source.python', - '--tests,': '', - '--skips,': '' - } + defaults = {"selector": "source.python", "--tests,": "", "--skips,": ""}