Skip to content

Commit

Permalink
chore: lint and error fix
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
  • Loading branch information
spiffcs committed Dec 9, 2024
1 parent 59b3662 commit 1cc2248
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/syft/internal/options/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"sort"
"strings"

stereoscopeFile "github.com/anchore/stereoscope/pkg/file"
"github.com/dustin/go-humanize"
"github.com/scylladb/go-set/strset"

"github.com/anchore/clio"
stereoscopeFile "github.com/anchore/stereoscope/pkg/file"
"github.com/anchore/syft/syft/source/sourceproviders"
)

Expand Down
3 changes: 2 additions & 1 deletion syft/format/common/spdxhelpers/to_format_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,8 @@ func toFiles(s sbom.SBOM) (results []*spdx.File) {

relativePath, err := convertAbsoluteToRelative(coordinates.RealPath)
if err != nil {
// TODO:
log.Debugf("unable to convert relative path '%s' to absolute path: %s", coordinates.RealPath, err)
relativePath = coordinates.RealPath
}

results = append(results, &spdx.File{
Expand Down
4 changes: 2 additions & 2 deletions syft/format/common/spdxhelpers/to_format_model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,10 @@ func Test_toFiles(t *testing.T) {
Version: "version-1",
}),
FileMetadata: map[file.Coordinates]file.Metadata{
file.Coordinates{
{
RealPath: "/some/path",
FileSystemID: "",
}: file.Metadata{
}: {
Path: "/some/path",
},
},
Expand Down
3 changes: 2 additions & 1 deletion syft/internal/fileresolver/file_indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"os"
"path/filepath"

"github.com/wagoodman/go-progress"

"github.com/anchore/stereoscope/pkg/file"
"github.com/anchore/stereoscope/pkg/filetree"
"github.com/anchore/syft/internal/log"
"github.com/anchore/syft/syft/internal/windows"
"github.com/wagoodman/go-progress"
)

type fileIndexer struct {
Expand Down
8 changes: 5 additions & 3 deletions syft/internal/fileresolver/file_indexer_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package fileresolver

import (
"github.com/anchore/stereoscope/pkg/file"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"io/fs"
"os"
"path"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/anchore/stereoscope/pkg/file"
)

// - Verify that both the parent and the path are indexed
Expand Down
5 changes: 3 additions & 2 deletions syft/internal/fileresolver/filetree_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ import (
"testing"
"time"

stereoscopeFile "github.com/anchore/stereoscope/pkg/file"
"github.com/anchore/syft/syft/file"
"github.com/google/go-cmp/cmp"
"github.com/scylladb/go-set/strset"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/goleak"

stereoscopeFile "github.com/anchore/stereoscope/pkg/file"
"github.com/anchore/syft/syft/file"
)

// Tests for filetree resolver when directory is used for index
Expand Down

0 comments on commit 1cc2248

Please sign in to comment.