Skip to content

Commit

Permalink
lint-fix
Browse files Browse the repository at this point in the history
Signed-off-by: Benji Visser <benji@093b.org>
  • Loading branch information
noqcks committed Sep 19, 2023
1 parent 088f412 commit 4390c34
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions test/cli/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"

"github.com/anchore/stereoscope/pkg/imagetest"
"github.com/stretchr/testify/require"
)

func getFixtureImage(tb testing.TB, fixtureImageName string) string {
Expand Down
3 changes: 1 addition & 2 deletions xeol/pkg/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/anchore/syft/syft/artifact"
"github.com/anchore/syft/syft/cpe"
"github.com/anchore/syft/syft/file"
"github.com/anchore/syft/syft/linux"
"github.com/anchore/syft/syft/pkg"
cpes "github.com/anchore/syft/syft/pkg/cataloger/common/cpe"

Expand Down Expand Up @@ -98,7 +97,7 @@ func (p Package) String() string {
return fmt.Sprintf("Pkg(type=%s, name=%s, version=%s, upstreams=%d)", p.Type, p.Name, p.Version, len(p.Upstreams))
}

func removePackagesByOverlap(catalog *pkg.Collection, relationships []artifact.Relationship, distro *linux.Release) *pkg.Collection {
func removePackagesByOverlap(catalog *pkg.Collection, relationships []artifact.Relationship) *pkg.Collection {
byOverlap := map[artifact.ID]artifact.Relationship{}
for _, r := range relationships {
if r.Type == artifact.OwnershipByFileOverlapRelationship {
Expand Down
2 changes: 1 addition & 1 deletion xeol/pkg/package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ func Test_RemovePackagesByOverlap(t *testing.T) {
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
catalog := removePackagesByOverlap(test.sbom.Artifacts.Packages, test.sbom.Relationships, test.sbom.Artifacts.LinuxDistribution)
catalog := removePackagesByOverlap(test.sbom.Artifacts.Packages, test.sbom.Relationships)
pkgs := FromCollection(catalog, SynthesisConfig{})
var pkgNames []string
for _, p := range pkgs {
Expand Down
2 changes: 1 addition & 1 deletion xeol/pkg/syft_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func syftProvider(userInput string, config ProviderConfig) ([]Package, Context,
return nil, Context{}, nil, err
}

catalog = removePackagesByOverlap(catalog, relationships, theDistro)
catalog = removePackagesByOverlap(catalog, relationships)

srcDescription := src.Describe()

Expand Down
2 changes: 1 addition & 1 deletion xeol/pkg/syft_sbom_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func syftSBOMProvider(userInput string, config ProviderConfig) ([]Package, Conte
return nil, Context{}, nil, err
}

catalog := removePackagesByOverlap(s.Artifacts.Packages, s.Relationships, s.Artifacts.LinuxDistribution)
catalog := removePackagesByOverlap(s.Artifacts.Packages, s.Relationships)

return FromCollection(catalog, config.SynthesisConfig), Context{
Source: &s.Source,
Expand Down

0 comments on commit 4390c34

Please sign in to comment.