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

Solving issues #5 and #6 #8

Merged
merged 6 commits into from
Dec 2, 2022
Merged

Solving issues #5 and #6 #8

merged 6 commits into from
Dec 2, 2022

Conversation

Franco0700
Copy link
Contributor

Also I added a message where it says the amount of ignored vulnerabilities.

@Franco0700
Copy link
Contributor Author

@opeco17

ignored_vulns = 0
for vulner in vulnerabilities:
if self.option("ignore-package"):
ignored_packages = self.option("ignore-package").split(',')
Copy link

Choose a reason for hiding this comment

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

pls avoid re-evaluating this on each iteration.

@@ -131,6 +141,39 @@ def get_json_report(self, vulnerabilities: List[Vulnerability]) -> str:
}
return json.dumps(json_report_dict, indent=2)

def get_suppressions(self):
ignored_packages, codes = None, None
Copy link

Choose a reason for hiding this comment

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

do they charge per keystroke? :)

ignored_vulns = 0
ignored_packages, codes = self.get_suppressions()
for vulner in vulnerabilities:
if self.option("ignore-package"):
Copy link

Choose a reason for hiding this comment

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

move this to a boolean flag

if vulner.name in ignored_packages:
ignored_vulns += 1
continue
if self.option("ignore-code"):
Copy link

Choose a reason for hiding this comment

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

ditto, parse options at the beginning


assert dev_vulnerability in vulnerabilitie_names
assert "ansible-tower-cli" not in vulnerabilitie_names
assert result.returncode == 1
Copy link

Choose a reason for hiding this comment

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

pls add the EOL

@opeco17
Copy link
Owner

opeco17 commented Dec 2, 2022

@Franco0700
Thank you for implementing the feature
Let me prepare to release new version after fixing styles

@opeco17
Copy link
Owner

opeco17 commented Dec 2, 2022

@dgutson
Thank you for reviewing PR
It's very helpful

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.

3 participants