Skip to content

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
Member

@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
Member

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
Member

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