Festo-se / cyclonedx-editor-validator

Tool for creating, modifying and validating CycloneDX SBOMs.
https://festo-se.github.io/cyclonedx-editor-validator/
GNU General Public License v3.0
16 stars 4 forks source link

refactor: change report options for validate function #204

Closed mmarseu closed 4 weeks ago

mmarseu commented 1 month ago

This PR reworks the command-line options for report creation in the validate command.

Previously:

This was confusing because the interaction between both arguments wasn't clear (what if you set stdout but still provide an --output or no --output but still a --report-format?) and because the help text for --output was wrong (it was reused from other commands which output SBOMs, not validation reports).

This PR makes these breaking changes:

github-actions[bot] commented 1 month ago

Coverage

Coverage Report •
FileStmtsMissCoverMissing
__main__.py3202093%215–216, 233, 243, 657–658, 662–667, 669, 672, 682–685, 689, 846
validator
   validate.py79494%39, 87, 103, 138
TOTAL16107195% 

Tests Skipped Failures Errors Time
287 2 :zzz: 0 :x: 0 :fire: 4.485s :stopwatch:
mmarseu commented 4 weeks ago

The documentation still contains the old examples:

cdx-ev validate bom.json --report-format=warnings-ng" # writes issues to a file "issues.json" and stdout
cdx-ev validate bom.json --report-format=warnings-ng --output=myfile.json" # write issues to a file "myfile.json" and stdout
cdx-ev validate bom.json --report-format=gitlab-code-quality # writes issues to a file "issues.json" and stdout

The new depdendency should be mentioned as well.

By new dependency you mean the two options --report-format and --report-path? Because I can't see that I've introduced a new dependency to the project in this PR.

I've updates this section in the latest change.

CBeck-96 commented 4 weeks ago

The documentation still contains the old examples:

cdx-ev validate bom.json --report-format=warnings-ng" # writes issues to a file "issues.json" and stdout
cdx-ev validate bom.json --report-format=warnings-ng --output=myfile.json" # write issues to a file "myfile.json" and stdout
cdx-ev validate bom.json --report-format=gitlab-code-quality # writes issues to a file "issues.json" and stdout

The new depdendency should be mentioned as well.

By new dependency you mean the two options --report-format and --report-path? Because I can't see that I've introduced a new dependency to the project in this PR.

I've updates this section in the latest change.

Sorry, mistake on my part, i meant exactly those commands/command names.