Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include confidence level and severity in the msg #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion flake8_bandit.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ def _check_source(self):
"test_id": item.test_id.replace("B", "S"),
"issue_text": item.text,
"line_number": item.lineno,
"severity": item.severity,
"confidence": item.confidence,
}
for item in bnv.tester.results
]
Expand All @@ -133,7 +135,12 @@ def run(self):
if not self.tree or not self.lines:
self._load_source()
for warn in self._check_source():
message = "%s %s" % (warn["test_id"], warn["issue_text"])
message = "%s %s (CL: %s, risk: %s)" % (
warn["test_id"],
warn["issue_text"],
warn["confidence"],
warn["severity"],
)
yield (warn["line_number"], 0, message, type(self))

def _load_source(self):
Expand Down