-
Notifications
You must be signed in to change notification settings - Fork 314
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
Reporter API enhancements #8910
Conversation
Remove these custom extension functions in favor of standard functionality. The resulting code is a bit longer, but makes more clear what the default value is. Signed-off-by: Sebastian Schuberth <[email protected]>
As of 78fb986 `FileFormat` only has `JSON` and `YAML` entries, so the `when` clause is exhausitve and the `else` branch can be removed. Signed-off-by: Sebastian Schuberth <[email protected]>
0bac376
to
72806d0
Compare
@@ -43,32 +43,30 @@ | |||
|
|||
override val type = "EvaluatedModel" | |||
|
|||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> { | |||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> { |
Check warning
Code scanning / detekt
Format signature to be single when possible, multiple lines otherwise. Warning
@@ -43,32 +43,30 @@ | |||
|
|||
override val type = "EvaluatedModel" | |||
|
|||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> { | |||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> { |
Check warning
Code scanning / detekt
Format signature to be single when possible, multiple lines otherwise. Warning
@@ -43,32 +43,30 @@ | |||
|
|||
override val type = "EvaluatedModel" | |||
|
|||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> { | |||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> { |
Check warning
Code scanning / detekt
Format signature to be single when possible, multiple lines otherwise. Warning
@@ -43,32 +43,30 @@ | |||
|
|||
override val type = "EvaluatedModel" | |||
|
|||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> { | |||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> { |
Check warning
Code scanning / detekt
Format signature to be single when possible, multiple lines otherwise. Warning
@@ -43,32 +43,30 @@ | |||
|
|||
override val type = "EvaluatedModel" | |||
|
|||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> { | |||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> { |
Check warning
Code scanning / detekt
Line detected, which is longer than the defined maximum line length in the code style. Warning
@@ -36,7 +36,7 @@ | |||
|
|||
override val type = "FossIdSnippet" | |||
|
|||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> { | |||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> { |
Check warning
Code scanning / detekt
Format signature to be single when possible, multiple lines otherwise. Warning
@@ -36,7 +36,7 @@ | |||
|
|||
override val type = "FossIdSnippet" | |||
|
|||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> { | |||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> { |
Check warning
Code scanning / detekt
Format signature to be single when possible, multiple lines otherwise. Warning
@@ -36,7 +36,7 @@ | |||
|
|||
override val type = "FossIdSnippet" | |||
|
|||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> { | |||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> { |
Check warning
Code scanning / detekt
Format signature to be single when possible, multiple lines otherwise. Warning
@@ -36,7 +36,7 @@ | |||
|
|||
override val type = "FossIdSnippet" | |||
|
|||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> { | |||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> { |
Check warning
Code scanning / detekt
Format signature to be single when possible, multiple lines otherwise. Warning
@@ -36,7 +36,7 @@ | |||
|
|||
override val type = "FossIdSnippet" | |||
|
|||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> { | |||
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> { |
Check warning
Code scanning / detekt
Line detected, which is longer than the defined maximum line length in the code style. Warning
8591cf5
to
7989e35
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8910 +/- ##
=========================================
Coverage 67.63% 67.63%
Complexity 1168 1168
=========================================
Files 244 244
Lines 7781 7781
Branches 867 867
=========================================
Hits 5263 5263
Misses 2161 2161
Partials 357 357
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Instead of an all-or-nothing approach with throwing an exception, allow per-file-format results for reporters to signal that e.g. writing a JSON format succeeded while writing an XML format for the same reporter failed. This fixes the issue introduced in 5503c68 for the CycloneDX reporter to not cause a non-0 exit code anymore for the reporter CLI if one of the file formats failed to be created. Signed-off-by: Sebastian Schuberth <[email protected]>
Please have a look at the individual commit messages for the details.