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

Use packageurl version 0.9.3 and Add nginx importer #264

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

sbs2001
Copy link
Collaborator

@sbs2001 sbs2001 commented Oct 7, 2020

Signed-off-by: Shivam Sandbhor shivam.sandbhor@gmail.com

Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
@sbs2001
Copy link
Collaborator Author

sbs2001 commented Oct 7, 2020

Fixes #96

@sbs2001 sbs2001 mentioned this pull request Oct 7, 2020
Copy link
Collaborator

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

I am merging this leave aside the few nitpickings... we should definitely add tests though!
Thanks!

import dataclasses
import json

import requests
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: we should sort imports. But we should also switch to using black and isort, so we can do it all at once!

return advisories

def extract_fixed_pkgs(self, vuln_info):
vuln_status, version_info = vuln_info.split(": ")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Using a .partition() is more robust as it always does a single split and always return three values making the tuple unpacking safer and more reliable. I tend to prefer it followed by a .strip() call.

@pombredanne pombredanne merged commit d6832bd into aboutcode-org:main Nov 17, 2020
@sbs2001 sbs2001 mentioned this pull request Nov 20, 2020
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.

2 participants