forked from anchore/syft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for new Copyrights and schema updates
### JSON Schema - **Added**: New JSON schema version `16.0.16` with support for the new `Copyrights`. - **Modified**: Updated the `JSONSchemaVersion` parameter to use the new schema. ### Package Structs - **Added**: New `Copyrights` field to the `Package` and `PackageBasicData` structs, similar to the existing `Licenses` field. - **Added**: New `Copyright` struct. - **Implemented**: Sorting methods for the `Copyright` struct. ### toPackages Function - **Changed**: Updated the `PackageCopyrightText` to use `helpers.GetCopyrights(p.Copyrights)`, which formats the copyright text and returns a string. Example output: "Copyright 2014-2014 Matt Zabriskie & Collaborators". ### toSyftPackage Function - **Added**: `Copyrights` assignment to the `toSyftPackage` function. Signed-off-by: dor-hayun <dor.hayun@mend.io>
- Loading branch information
dor-hayun
committed
Aug 26, 2024
1 parent
73b9d5a
commit 3af0232
Showing
16 changed files
with
2,985 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package cmptest | ||
|
||
import ( | ||
"github.com/anchore/syft/syft/pkg" | ||
"github.com/google/go-cmp/cmp" | ||
) | ||
|
||
type CopyrightComparer func(x, y pkg.Copyright) bool | ||
|
||
func DefaultCopyrightComparer(x, y pkg.Copyright) bool { | ||
return cmp.Equal(x, y, cmp.Comparer( | ||
func(x, y string) bool { | ||
return x == y | ||
}, | ||
)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.