chore: Update syft bootstrap tools to latest versions. (#1682)

Signed-off-by: Keith Zantow <kzantow@gmail.com>
This commit is contained in:
anchore-actions-token-generator[bot] 2023-03-20 13:20:48 -04:00 committed by GitHub
parent 5fb0423b72
commit 434aa7fd46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 20 additions and 18 deletions

View File

@ -10,11 +10,11 @@ CHRONICLE_CMD = $(TEMP_DIR)/chronicle
GLOW_CMD = $(TEMP_DIR)/glow GLOW_CMD = $(TEMP_DIR)/glow
# Tool versions ################################# # Tool versions #################################
GOLANGCILINT_VERSION := v1.51.2 GOLANGCILINT_VERSION := v1.52.0
GOSIMPORTS_VERSION := v0.3.8 GOSIMPORTS_VERSION := v0.3.8
BOUNCER_VERSION := v0.4.0 BOUNCER_VERSION := v0.4.0
CHRONICLE_VERSION := v0.6.0 CHRONICLE_VERSION := v0.6.0
GORELEASER_VERSION := v1.16.1 GORELEASER_VERSION := v1.16.2
YAJSV_VERSION := v1.4.1 YAJSV_VERSION := v1.4.1
COSIGN_VERSION := v1.13.1 COSIGN_VERSION := v1.13.1
QUILL_VERSION := v0.2.0 QUILL_VERSION := v0.2.0

View File

@ -27,7 +27,7 @@ import (
"github.com/anchore/syft/syft/source" "github.com/anchore/syft/syft/source"
) )
func Run(ctx context.Context, app *config.Application, args []string) error { func Run(_ context.Context, app *config.Application, args []string) error {
err := ValidateOutputOptions(app) err := ValidateOutputOptions(app)
if err != nil { if err != nil {
return err return err

View File

@ -17,6 +17,7 @@ func (o AttestOptions) AddFlags(cmd *cobra.Command, v *viper.Viper) error {
return bindAttestConfigOptions(cmd.Flags(), v) return bindAttestConfigOptions(cmd.Flags(), v)
} }
//nolint:revive
func bindAttestConfigOptions(flags *pflag.FlagSet, v *viper.Viper) error { func bindAttestConfigOptions(flags *pflag.FlagSet, v *viper.Viper) error {
if err := v.BindPFlag("attest.key", flags.Lookup("key")); err != nil { if err := v.BindPFlag("attest.key", flags.Lookup("key")); err != nil {
return err return err

View File

@ -31,6 +31,7 @@ func (o *FulcioOptions) AddFlags(cmd *cobra.Command, v *viper.Viper) error {
return bindFulcioConfigOptions(cmd.Flags(), v) return bindFulcioConfigOptions(cmd.Flags(), v)
} }
//nolint:revive
func bindFulcioConfigOptions(flags *pflag.FlagSet, v *viper.Viper) error { func bindFulcioConfigOptions(flags *pflag.FlagSet, v *viper.Viper) error {
if err := v.BindPFlag("attest.fulcio-url", flags.Lookup("fulcio-url")); err != nil { if err := v.BindPFlag("attest.fulcio-url", flags.Lookup("fulcio-url")); err != nil {
return err return err

View File

@ -31,6 +31,7 @@ func (o *OIDCOptions) AddFlags(cmd *cobra.Command, v *viper.Viper) error {
return bindOIDCConfigOptions(cmd.Flags(), v) return bindOIDCConfigOptions(cmd.Flags(), v)
} }
//nolint:revive
func bindOIDCConfigOptions(flags *pflag.FlagSet, v *viper.Viper) error { func bindOIDCConfigOptions(flags *pflag.FlagSet, v *viper.Viper) error {
if err := v.BindPFlag("attest.oidc-issuer", flags.Lookup("oidc-issuer")); err != nil { if err := v.BindPFlag("attest.oidc-issuer", flags.Lookup("oidc-issuer")); err != nil {
return err return err

View File

@ -54,6 +54,7 @@ func (o *PackagesOptions) AddFlags(cmd *cobra.Command, v *viper.Viper) error {
return bindPackageConfigOptions(cmd.Flags(), v) return bindPackageConfigOptions(cmd.Flags(), v)
} }
//nolint:revive
func bindPackageConfigOptions(flags *pflag.FlagSet, v *viper.Viper) error { func bindPackageConfigOptions(flags *pflag.FlagSet, v *viper.Viper) error {
// Formatting & Input options ////////////////////////////////////////////// // Formatting & Input options //////////////////////////////////////////////

View File

@ -22,6 +22,7 @@ func (o *RekorOptions) AddFlags(cmd *cobra.Command, v *viper.Viper) error {
return bindRekorConfigOptions(cmd.Flags(), v) return bindRekorConfigOptions(cmd.Flags(), v)
} }
//nolint:revive
func bindRekorConfigOptions(flags *pflag.FlagSet, v *viper.Viper) error { func bindRekorConfigOptions(flags *pflag.FlagSet, v *viper.Viper) error {
// TODO: config re-design // TODO: config re-design
if err := v.BindPFlag("attest.rekor-url", flags.Lookup("rekor-url")); err != nil { if err := v.BindPFlag("attest.rekor-url", flags.Lookup("rekor-url")); err != nil {

View File

@ -22,6 +22,7 @@ func (o *RootOptions) AddFlags(cmd *cobra.Command, v *viper.Viper) error {
return bindRootConfigOptions(cmd.PersistentFlags(), v) return bindRootConfigOptions(cmd.PersistentFlags(), v)
} }
//nolint:revive
func bindRootConfigOptions(flags *pflag.FlagSet, v *viper.Viper) error { func bindRootConfigOptions(flags *pflag.FlagSet, v *viper.Viper) error {
if err := v.BindPFlag("config", flags.Lookup("config")); err != nil { if err := v.BindPFlag("config", flags.Lookup("config")); err != nil {
return err return err

View File

@ -11,7 +11,7 @@ type VersionOptions struct {
var _ Interface = (*VersionOptions)(nil) var _ Interface = (*VersionOptions)(nil)
func (o *VersionOptions) AddFlags(cmd *cobra.Command, v *viper.Viper) error { func (o *VersionOptions) AddFlags(cmd *cobra.Command, _ *viper.Viper) error {
cmd.Flags().StringVarP(&o.Output, "output", "o", "text", "format to show version information (available=[text, json])") cmd.Flags().StringVarP(&o.Output, "output", "o", "text", "format to show version information (available=[text, json])")
return nil return nil
} }

View File

@ -23,7 +23,7 @@ import (
"github.com/anchore/syft/syft/source" "github.com/anchore/syft/syft/source"
) )
func Run(ctx context.Context, app *config.Application, args []string) error { func Run(_ context.Context, app *config.Application, args []string) error {
err := ValidateOutputOptions(app) err := ValidateOutputOptions(app)
if err != nil { if err != nil {
return err return err

View File

@ -15,7 +15,7 @@ import (
"github.com/anchore/syft/internal/version" "github.com/anchore/syft/internal/version"
) )
func Version(v *viper.Viper, app *config.Application) *cobra.Command { func Version(v *viper.Viper, _ *config.Application) *cobra.Command {
o := &options.VersionOptions{} o := &options.VersionOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "version", Use: "version",

View File

@ -161,10 +161,7 @@ func UnzipToDir(archivePath, targetDir string) error {
return err return err
} }
if err = extractSingleFile(file, joinedPath, archivePath); err != nil { return extractSingleFile(file, joinedPath, archivePath)
return err
}
return nil
} }
return TraverseFilesInZip(archivePath, visitor) return TraverseFilesInZip(archivePath, visitor)

View File

@ -106,9 +106,8 @@ func stripSlashes(s string) string {
for i, c := range s { for i, c := range s {
if c == '\\' && i+1 < len(s) && strings.ContainsRune(allowedCPEPunctuation, rune(s[i+1])) { if c == '\\' && i+1 < len(s) && strings.ContainsRune(allowedCPEPunctuation, rune(s[i+1])) {
continue continue
} else {
sb.WriteRune(c)
} }
sb.WriteRune(c)
} }
return sb.String() return sb.String()
} }

View File

@ -105,7 +105,7 @@ func runCataloger(cataloger pkg.Cataloger, resolver source.FileResolver) (catalo
// request. // request.
// //
//nolint:funlen //nolint:funlen
func Catalog(resolver source.FileResolver, release *linux.Release, parallelism int, catalogers ...pkg.Cataloger) (*pkg.Catalog, []artifact.Relationship, error) { func Catalog(resolver source.FileResolver, _ *linux.Release, parallelism int, catalogers ...pkg.Cataloger) (*pkg.Catalog, []artifact.Relationship, error) {
catalog := pkg.NewCatalog() catalog := pkg.NewCatalog()
var allRelationships []artifact.Relationship var allRelationships []artifact.Relationship

View File

@ -82,11 +82,12 @@ func printError(data []byte, i int) string {
if c == '\n' { if c == '\n' {
prev = append(prev, curr.String()) prev = append(prev, curr.String())
curr.Reset() curr.Reset()
if idx >= i { if idx >= i {
break break
} else {
line++
} }
line++
char = 1 char = 1
continue continue
} }

View File

@ -104,9 +104,8 @@ func parsePackageLock(resolver source.FileResolver, _ *generic.Environment, read
if name == "" { if name == "" {
if pkgMeta.Name == "" { if pkgMeta.Name == "" {
continue continue
} else {
name = pkgMeta.Name
} }
name = pkgMeta.Name
} }
// handles alias names // handles alias names

View File

@ -199,7 +199,7 @@ func (r MockResolver) FilesByBasename(filenames ...string) ([]Location, error) {
return results, nil return results, nil
} }
func (r MockResolver) FilesByBasenameGlob(globs ...string) ([]Location, error) { func (r MockResolver) FilesByBasenameGlob(_ ...string) ([]Location, error) {
// TODO implement me // TODO implement me
panic("implement me") panic("implement me")
} }