Skip to content

Commit

Permalink
Fix the order of imports.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 681407906
  • Loading branch information
erikvarga authored and copybara-github committed Oct 3, 2024
1 parent 866c704 commit f6c721c
Show file tree
Hide file tree
Showing 41 changed files with 66 additions and 68 deletions.
2 changes: 1 addition & 1 deletion artifact/image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"strings"

"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/remote"
"github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/remote"
"github.com/google/osv-scalibr/artifact/image/require"
"github.com/google/osv-scalibr/artifact/image/unpack"
scalibrfs "github.com/google/osv-scalibr/fs"
Expand Down
2 changes: 1 addition & 1 deletion artifact/image/symlink/symlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"path/filepath"
"strings"

"github.com/google/uuid"
"github.com/google/osv-scalibr/log"
"github.com/google/uuid"
)

// RemoveObsoleteSymlinks removes symlinks that point to a destination file or directory path that
Expand Down
2 changes: 1 addition & 1 deletion artifact/image/tar/tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"os"
"strings"

"github.com/google/go-containerregistry/pkg/v1/mutate"
"github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/mutate"
"github.com/google/osv-scalibr/log"
)

Expand Down
2 changes: 1 addition & 1 deletion artifact/image/tar/tar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/google/go-containerregistry/pkg/v1/tarball"
"github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/tarball"
"github.com/google/osv-scalibr/artifact/image/tar"
)

Expand Down
2 changes: 1 addition & 1 deletion artifact/image/unpack/unpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (
"archive/tar"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/empty"
"github.com/google/go-containerregistry/pkg/v1/mutate"
"github.com/google/go-containerregistry/pkg/v1/tarball"
"github.com/google/go-containerregistry/pkg/v1"
"github.com/google/osv-scalibr/artifact/image/require"
"github.com/google/osv-scalibr/artifact/image/unpack"
)
Expand Down
2 changes: 1 addition & 1 deletion binary/cdx/cdx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"strings"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/CycloneDX/cyclonedx-go"
"github.com/google/go-cmp/cmp"
"github.com/google/osv-scalibr/binary/cdx"
)

Expand Down
6 changes: 3 additions & 3 deletions binary/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/v1/remote"
"github.com/spdx/tools-golang/spdx/v2/common"
scalibr "github.com/google/osv-scalibr"
scalibrimage "github.com/google/osv-scalibr/artifact/image"
"github.com/google/osv-scalibr/binary/cdx"
"github.com/google/osv-scalibr/binary/platform"
Expand All @@ -37,12 +37,12 @@ import (
dl "github.com/google/osv-scalibr/detector/list"
"github.com/google/osv-scalibr/extractor/filesystem"
el "github.com/google/osv-scalibr/extractor/filesystem/list"
sl "github.com/google/osv-scalibr/extractor/standalone/list"
"github.com/google/osv-scalibr/extractor/standalone"
sl "github.com/google/osv-scalibr/extractor/standalone/list"
scalibrfs "github.com/google/osv-scalibr/fs"
"github.com/google/osv-scalibr/log"
"github.com/google/osv-scalibr/plugin"
scalibr "github.com/google/osv-scalibr"
"github.com/spdx/tools-golang/spdx/v2/common"
)

// Array is a type to be passed to flag.Var that supports arrays passed as repeated flags,
Expand Down
2 changes: 1 addition & 1 deletion binary/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
scalibr "github.com/google/osv-scalibr"
"github.com/google/osv-scalibr/binary/cli"
"github.com/google/osv-scalibr/detector/govulncheck/binary"
"github.com/google/osv-scalibr/plugin"
scalibr "github.com/google/osv-scalibr"
)

func TestValidateFlags(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion binary/platform/platform_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"os"
"path/filepath"

"golang.org/x/sys/windows"
"github.com/google/osv-scalibr/plugin"
"golang.org/x/sys/windows"
)

var (
Expand Down
8 changes: 4 additions & 4 deletions binary/proto/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ import (
"path/filepath"
"strings"

"google.golang.org/protobuf/encoding/prototext"
"google.golang.org/protobuf/proto"
"github.com/google/osv-scalibr/converter"
"github.com/google/osv-scalibr/detector"
"github.com/google/osv-scalibr/log"
"google.golang.org/protobuf/encoding/prototext"
"google.golang.org/protobuf/proto"

scalibr "github.com/google/osv-scalibr"
"github.com/google/osv-scalibr/extractor"
ctrdfs "github.com/google/osv-scalibr/extractor/filesystem/containers/containerd"
"github.com/google/osv-scalibr/extractor/filesystem/language/java/archive"
Expand All @@ -48,10 +49,9 @@ import (
ctrdruntime "github.com/google/osv-scalibr/extractor/standalone/containers/containerd"
"github.com/google/osv-scalibr/plugin"
"github.com/google/osv-scalibr/purl"
scalibr "github.com/google/osv-scalibr"

"google.golang.org/protobuf/types/known/timestamppb"
spb "github.com/google/osv-scalibr/binary/proto/scan_result_go_proto"
"google.golang.org/protobuf/types/known/timestamppb"
)

// fileType represents the type of a proto result file.
Expand Down
6 changes: 3 additions & 3 deletions binary/proto/proto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"time"

"github.com/google/go-cmp/cmp"
"google.golang.org/protobuf/testing/protocmp"
scalibr "github.com/google/osv-scalibr"
"github.com/google/osv-scalibr/binary/proto"
"github.com/google/osv-scalibr/detector"
"github.com/google/osv-scalibr/extractor"
Expand All @@ -39,10 +39,10 @@ import (
ctrdruntime "github.com/google/osv-scalibr/extractor/standalone/containers/containerd"
"github.com/google/osv-scalibr/plugin"
"github.com/google/osv-scalibr/purl"
scalibr "github.com/google/osv-scalibr"
"google.golang.org/protobuf/testing/protocmp"

"google.golang.org/protobuf/types/known/timestamppb"
spb "github.com/google/osv-scalibr/binary/proto/scan_result_go_proto"
"google.golang.org/protobuf/types/known/timestamppb"
)

func TestWrite(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion binary/scanrunner/scanrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ package scanrunner
import (
"context"

scalibr "github.com/google/osv-scalibr"
"github.com/google/osv-scalibr/binary/cli"
"github.com/google/osv-scalibr/log"
"github.com/google/osv-scalibr/plugin"
scalibr "github.com/google/osv-scalibr"
)

// RunScan executes the scan with the given CLI flags
Expand Down
2 changes: 1 addition & 1 deletion binary/scanrunner/scanrunner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"google.golang.org/protobuf/encoding/prototext"
"github.com/google/osv-scalibr/binary/cli"
"github.com/google/osv-scalibr/binary/scanrunner"
"google.golang.org/protobuf/encoding/prototext"

spb "github.com/google/osv-scalibr/binary/proto/scan_result_go_proto"
)
Expand Down
2 changes: 1 addition & 1 deletion binary/spdx/spdx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/spdx/tools-golang/spdx/v2/v2_3"
"github.com/google/osv-scalibr/binary/spdx"
"github.com/spdx/tools-golang/spdx/v2/v2_3"
)

var doc = &v2_3.Document{
Expand Down
8 changes: 4 additions & 4 deletions converter/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import (
"time"

"github.com/CycloneDX/cyclonedx-go"
"github.com/spdx/tools-golang/spdx/v2/common"
"github.com/spdx/tools-golang/spdx/v2/v2_3"
"github.com/google/uuid"
scalibr "github.com/google/osv-scalibr"
"github.com/google/osv-scalibr/extractor"
"github.com/google/osv-scalibr/log"
"github.com/google/osv-scalibr/purl"
scalibr "github.com/google/osv-scalibr"
"github.com/google/uuid"
"github.com/spdx/tools-golang/spdx/v2/common"
"github.com/spdx/tools-golang/spdx/v2/v2_3"
)

const (
Expand Down
10 changes: 5 additions & 5 deletions converter/converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ import (
"runtime"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/CycloneDX/cyclonedx-go"
"github.com/spdx/tools-golang/spdx/v2/common"
"github.com/spdx/tools-golang/spdx/v2/v2_3"
"github.com/google/uuid"
"github.com/google/go-cmp/cmp"
scalibr "github.com/google/osv-scalibr"
"github.com/google/osv-scalibr/converter"
"github.com/google/osv-scalibr/extractor"
"github.com/google/osv-scalibr/extractor/filesystem/language/python/wheelegg"
"github.com/google/osv-scalibr/extractor/filesystem/sbom/spdx"
"github.com/google/osv-scalibr/extractor/standalone/windows/dismpatch"
"github.com/google/osv-scalibr/purl"
scalibr "github.com/google/osv-scalibr"
"github.com/google/uuid"
"github.com/spdx/tools-golang/spdx/v2/common"
"github.com/spdx/tools-golang/spdx/v2/v2_3"
)

func TestToSPDX23(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/google/osv-scalibr/detector/cis/generic_linux/etcpasswdpermissions"
"github.com/google/osv-scalibr/detector"
"github.com/google/osv-scalibr/detector/cis/generic_linux/etcpasswdpermissions"
"github.com/google/osv-scalibr/extractor"
scalibrfs "github.com/google/osv-scalibr/fs"
"github.com/google/osv-scalibr/inventoryindex"
Expand Down
2 changes: 1 addition & 1 deletion detector/cve/cve202338408/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"regexp"
"strings"

"github.com/google/osv-scalibr/detector/cve/cve202338408/semantic"
"github.com/google/osv-scalibr/detector"
"github.com/google/osv-scalibr/detector/cve/cve202338408/semantic"
scalibrfs "github.com/google/osv-scalibr/fs"
"github.com/google/osv-scalibr/inventoryindex"
"github.com/google/osv-scalibr/log"
Expand Down
2 changes: 1 addition & 1 deletion detector/govulncheck/binary/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import (
"path"
"strings"

"golang.org/x/vuln/scan"
"github.com/google/osv-scalibr/detector"
"github.com/google/osv-scalibr/extractor/filesystem/language/golang/gobinary"
scalibrfs "github.com/google/osv-scalibr/fs"
"github.com/google/osv-scalibr/inventoryindex"
"github.com/google/osv-scalibr/log"
"github.com/google/osv-scalibr/plugin"
"github.com/google/osv-scalibr/purl"
"golang.org/x/vuln/scan"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions detector/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ import (
"slices"
"strings"

"github.com/google/osv-scalibr/detector"
"github.com/google/osv-scalibr/detector/cis/generic_linux/etcpasswdpermissions"
"github.com/google/osv-scalibr/detector/cve/cve202338408"
"github.com/google/osv-scalibr/detector"
"github.com/google/osv-scalibr/detector/govulncheck/binary"
"github.com/google/osv-scalibr/detector/weakcredentials/etcshadow"
"github.com/google/osv-scalibr/detector/weakcredentials/filebrowser"
"github.com/google/osv-scalibr/log"
"github.com/google/osv-scalibr/plugin"

)

// CIS scanning related detectors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"strings"
"time"

bolt "go.etcd.io/bbolt"
"github.com/containerd/containerd/metadata"
"github.com/containerd/containerd/namespaces"
"github.com/google/osv-scalibr/extractor"
Expand All @@ -38,6 +37,7 @@ import (
"github.com/google/osv-scalibr/log"
"github.com/google/osv-scalibr/plugin"
"github.com/google/osv-scalibr/purl"
bolt "go.etcd.io/bbolt"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/google/osv-scalibr/extractor"
"github.com/google/osv-scalibr/extractor/filesystem/containers/containerd"
"github.com/google/osv-scalibr/extractor/filesystem"
"github.com/google/osv-scalibr/extractor/filesystem/containers/containerd"
"github.com/google/osv-scalibr/extractor/filesystem/internal/units"
)

Expand Down
4 changes: 2 additions & 2 deletions extractor/filesystem/language/golang/gomod/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import (
"path/filepath"
"strings"

"golang.org/x/exp/maps"
"golang.org/x/mod/modfile"
"github.com/google/osv-scalibr/extractor"
"github.com/google/osv-scalibr/extractor/filesystem"
"github.com/google/osv-scalibr/plugin"
"github.com/google/osv-scalibr/purl"
"golang.org/x/exp/maps"
"golang.org/x/mod/modfile"
)

// Extractor extracts go packages from a go.mod file,
Expand Down
2 changes: 1 addition & 1 deletion extractor/filesystem/language/java/archive/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ import (
"path/filepath"
"strings"

"go.uber.org/multierr"
"github.com/google/osv-scalibr/extractor"
"github.com/google/osv-scalibr/extractor/filesystem"
"github.com/google/osv-scalibr/extractor/filesystem/internal/units"
"github.com/google/osv-scalibr/log"
"github.com/google/osv-scalibr/plugin"
"github.com/google/osv-scalibr/purl"
"github.com/google/osv-scalibr/stats"
"go.uber.org/multierr"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import (
"slices"
"strings"

"github.com/google/osv-scanner/pkg/lockfile"
"github.com/google/osv-scalibr/extractor"
"github.com/google/osv-scalibr/extractor/filesystem"
"github.com/google/osv-scalibr/extractor/filesystem/osv"
"github.com/google/osv-scalibr/plugin"
"github.com/google/osv-scalibr/purl"
"github.com/google/osv-scalibr/stats"
"github.com/google/osv-scanner/pkg/lockfile"
)

// Config is the configuration for the Extractor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (

"github.com/google/osv-scalibr/extractor"
"github.com/google/osv-scalibr/extractor/filesystem"
"github.com/google/osv-scalibr/extractor/filesystem/language/python/internal/pypipurl"
scalibrfs "github.com/google/osv-scalibr/fs"
"github.com/google/osv-scalibr/log"
"github.com/google/osv-scalibr/extractor/filesystem/language/python/internal/pypipurl"
"github.com/google/osv-scalibr/plugin"
"github.com/google/osv-scalibr/purl"
"github.com/google/osv-scalibr/stats"
Expand Down
1 change: 0 additions & 1 deletion extractor/filesystem/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ import (
"github.com/google/osv-scalibr/log"
"github.com/google/osv-scalibr/plugin"
"github.com/google/osv-scalibr/purl"

)

// LINT.IfChange
Expand Down
2 changes: 1 addition & 1 deletion extractor/filesystem/os/apk/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (e Extractor) extractFromInput(ctx context.Context, input *filesystem.ScanI
License: license,
},
SourceCode: sourceCode,
Locations: []string{input.Path},
Locations: []string{input.Path},
})
}
return pkgs, nil
Expand Down
Loading

0 comments on commit f6c721c

Please sign in to comment.