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
Add more_info URL to text output #359
Conversation
Outputting bandit report as text does not put `more_info` URL while it would if the output format is YAML or JSON. This patch set adds the `more_info` URL to the text display. Signed-off-by: Tin Lam <tin@irrational.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, nit change request. Otherwise good-to-go
bandit/formatters/text.py
Outdated
@@ -27,6 +27,8 @@ | |||
>> Issue: [B301:blacklist_calls] Use of unsafe yaml load. Allows | |||
instantiation of arbitrary objects. Consider yaml.safe_load(). | |||
|
|||
More Info: https://bandit.readthedocs.io/en/latest/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move the more info below the location? That would be more consistent with other formatters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
bandit/formatters/text.py
Outdated
@@ -81,6 +84,9 @@ def _output_issue_str(issue, indent, show_lineno=True, show_code=True, | |||
bits.append("%s>> Issue: [%s:%s] %s" % ( | |||
indent, issue.test_id, issue.test, issue.text)) | |||
|
|||
bits.append("%s More Info: %s" % ( | |||
indent, docs_utils.get_url(issue.test_id))) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move to after location
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Outputting bandit report as text does not put
more_info
URL while itwould if the output format is YAML or JSON. This patch set adds the
more_info
URL to the text display.Signed-off-by: Tin Lam tin@irrational.io