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 the line number when using HTML output format #683

Merged
merged 1 commit into from
Dec 27, 2020
Merged

Include the line number when using HTML output format #683

merged 1 commit into from
Dec 27, 2020

Conversation

aludwin1
Copy link
Contributor

@aludwin1 aludwin1 commented Dec 25, 2020

This commit is to include the line number of a given occurrence when using HTML output format.

Resolves: #672

@ericwb ericwb changed the title This commit is to include the line number of a given occurance when u… Include the line number when using HTML output format Dec 27, 2020
Copy link
Member

@ericwb ericwb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly ready. Ideally you could include the column number too, but could be in a separate PR. Thanks for the PR!

bandit/formatters/html.py Outdated Show resolved Hide resolved
@@ -263,6 +263,7 @@ def report(manager, fileobj, sev_level, conf_level, lines=-1):
<b>Severity: </b>{severity}<br>
<b>Confidence: </b>{confidence}<br>
<b>File: </b><a href="{path}" target="_blank">{path}</a> <br>
<b>Line number: </b>{line_number}</a> <br>
<b>More info: </b><a href="{url}" target="_blank">{url}</a><br>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about also adding the column number? Thanks

Copy link
Contributor Author

@aludwin1 aludwin1 Dec 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem! I'll attempt that change in another PR. Thanks for taking a look!

@aludwin1 aludwin1 requested a review from ericwb December 27, 2020 04:02
Copy link
Member

@ericwb ericwb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@ericwb ericwb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, just noticed a stray in your HTML

bandit/formatters/html.py Outdated Show resolved Hide resolved
@aludwin1 aludwin1 requested a review from ericwb December 27, 2020 04:17
@ericwb ericwb merged commit 8eee173 into PyCQA:master Dec 27, 2020
@aludwin1 aludwin1 deleted the aludwin/627 branch December 27, 2020 05:20
mikespallino pushed a commit to mikespallino/bandit that referenced this pull request Aug 25, 2021
mikespallino pushed a commit to mikespallino/bandit that referenced this pull request Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTML formatter is missing line number
3 participants