Skip to content

Commit

Permalink
feat: update tests and spdxjson to omit empty
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Phillips <[email protected]>
  • Loading branch information
spiffcs committed Feb 5, 2025
1 parent 1b33456 commit 64ff665
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions cmd/syft/internal/commands/attest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ func Test_writeSBOMToFormattedFile(t *testing.T) {
"distro": {},
"descriptor": {
"name": "syft-test",
"version": "non-version",
"supplier": ""
"version": "non-version"
},
"schema": {}
}`,
Expand Down
2 changes: 1 addition & 1 deletion syft/format/common/spdxhelpers/to_syft_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func containerSource(p *spdx.Package) source.Description {

supplier := ""
if p.PackageSupplier != nil {
// we also don't want NOASSERTION transfered to the syft format
// we also don't want NOASSERTION transferred to the syft format
// NOASSERTION == ""
if p.PackageSupplier.Supplier != helpers.NOASSERTION {
supplier = p.PackageSupplier.Supplier
Expand Down
2 changes: 1 addition & 1 deletion syft/format/syftjson/model/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Document struct {
type Descriptor struct {
Name string `json:"name"`
Version string `json:"version"`
Supplier string `json:"supplier",omitempty`
Supplier string `json:"supplier,omitempty"`
Configuration interface{} `json:"configuration,omitempty"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
"descriptor": {
"name": "syft",
"version": "v0.42.0-bogus",
"supplier": "",
"configuration": {
"config-key": "config-value"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@
"descriptor": {
"name": "syft",
"version": "v0.42.0-bogus",
"supplier": "",
"configuration": {
"config-key": "config-value"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
"descriptor": {
"name": "syft",
"version": "v0.42.0-bogus",
"supplier": "",
"configuration": {
"config-key": "config-value"
}
Expand Down

0 comments on commit 64ff665

Please sign in to comment.