Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Output tweaks #172

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

Merged
KevinHock merged 4 commits into python-security:master from bcaller:formatter
Sep 7, 2018
Merged

Output tweaks #172

KevinHock merged 4 commits into python-security:master from bcaller:formatter
Sep 7, 2018

Conversation

Copy link
Collaborator

@bcaller bcaller commented Sep 5, 2018
edited
Loading

  • Adds --screen output for ANSI colour codes (not that colourful to be honest as I didn't want to go crazy)
  • Adds --only-unsanitised to not print santised vulnerabilities as they can confuse the output
  • Adds basic logging of what pyt is doing with -v, -vv or -vvv

pytvuln

vulns

Copy link
Collaborator Author

bcaller commented Sep 5, 2018

I just removed the underline from the sink in the images above as it obscures underscores. Otherwise it's the same.

Prints vulnerabilities with ANSI colour codes for the terminal.
Not crazily colourful: just tries to highlight the important stuff.
Repeated filenames aren't printed.
Colour scheme might not be to everyone's taste.
It is sometimes what you want, but often you just want the failures
without sanitised vulns in the output.
Very basic python logging added to pyt.
Very useful when you want to see:
- which files are being processed
- if your imports are not being inspected
- which file crashed pyt
@KevinHock KevinHock self-requested a review September 5, 2018 19:50
Copy link
Collaborator

This is lovely! ❤️ 😁 I'll have a look as soon as I can

Copy link
Collaborator

@KevinHock KevinHock left a comment

Choose a reason for hiding this comment

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

Looks great to me!

"""This formatter outputs the issues as color-coded text."""
from ..vulnerabilities.vulnerability_helper import SanitisedVulnerability, UnknownVulnerability

RESET = '033円[0m'
Copy link
Collaborator

@KevinHock KevinHock Sep 7, 2018

Choose a reason for hiding this comment

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

❤️

@KevinHock KevinHock merged commit c7b244d into python-security:master Sep 7, 2018
@@ -64,6 +65,14 @@ def retrieve_nosec_lines(
def main(command_line_args=sys.argv[1:]): # noqa: C901
args = parse_args(command_line_args)

logging_level = (
Copy link
Collaborator

@KevinHock KevinHock Sep 7, 2018

Choose a reason for hiding this comment

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

This is one of the prettiest ways I've seen people set the logging level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@KevinHock KevinHock KevinHock approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /