Add --scanner Parameters to Hoppr-Cop CLI
Checklist
-
code has been updated to add --scanner CLI options -
code has been refactored to meet Sourcery's new standards for function length -
unit tests updated to test changes
Description
Context
For my first hoppr-cop project, I was tasked with adding CLI options to the hoppr-cop application. Back in the day, hoppr-cop would attempt to run all of the scanners when performing a vulnerability analysis, no matter what (or all scanners but oss in the case of --download-dbs). While scanners can be useful, the desire for this update was to make each scanner able to be toggled thanks to the --scanner option. This would give users more control over the app in general. In addition, prior functionality should be kept in the scenario where --scanner isn't specified.
Intent
The ultimate goal of this merge request is to merge the following changes into the dev branch of hoppr-cop:
- The addition of --scanner CLI option that accepts the following case-insensitive string values:
- "grype"
- "trivy"
- "gem" and "gemnasium" (both options were added here)
- "oss" and "ossindex" (both options were added here)
- The refactoring of the cli.py code that ensures that it meets sourcery's standards (it met the standards before the updates, but adding new lines made it fail until refactoring was completed).
- Added extra unit tests that ensure that code coverage is over 85% for the entire project and that my added lines are fully covered.
Let me know if anything needs to be added/removed/modified/etc. for this release.
As for the original Gitlab ticket, this MR covers #92 (closed).