mirror of
https://github.com/anchore/syft
synced 2024-11-10 06:14:16 +00:00
chore(deps): update tools to latest versions (#2616)
* chore(deps): update tools to latest versions Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: update to new linter rules Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com> --------- Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com> Co-authored-by: spiffcs <32073428+spiffcs@users.noreply.github.com> Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com>
This commit is contained in:
parent
3ac7369068
commit
17ef243956
17 changed files with 27 additions and 27 deletions
|
@ -26,7 +26,7 @@ tools:
|
|||
# used for linting
|
||||
- name: golangci-lint
|
||||
version:
|
||||
want: v1.56.0
|
||||
want: v1.56.1
|
||||
method: github-release
|
||||
with:
|
||||
repo: golangci/golangci-lint
|
||||
|
|
|
@ -48,7 +48,7 @@ func AppClioSetupConfig(id clio.Identification, out io.Writer) *clio.SetupConfig
|
|||
return nil
|
||||
},
|
||||
).
|
||||
WithPostRuns(func(state *clio.State, err error) {
|
||||
WithPostRuns(func(_ *clio.State, _ error) {
|
||||
stereoscope.Cleanup()
|
||||
})
|
||||
return clioCfg
|
||||
|
|
|
@ -46,7 +46,7 @@ func CatalogerList(app clio.Application) *cobra.Command {
|
|||
return app.SetupCommand(&cobra.Command{
|
||||
Use: "list [OPTIONS]",
|
||||
Short: "List available catalogers",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
return runCatalogerList(opts)
|
||||
},
|
||||
}, opts)
|
||||
|
|
|
@ -47,7 +47,7 @@ func Convert(app clio.Application) *cobra.Command {
|
|||
}),
|
||||
Args: validateConvertArgs,
|
||||
PreRunE: applicationUpdateCheck(id, &opts.UpdateCheck),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(_ *cobra.Command, args []string) error {
|
||||
restoreStdout := ui.CaptureStdoutToTraceLog()
|
||||
defer restoreStdout()
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ var latestAppVersionURL = struct {
|
|||
}
|
||||
|
||||
func applicationUpdateCheck(id clio.Identification, check *options.UpdateCheck) func(cmd *cobra.Command, args []string) error {
|
||||
return func(cmd *cobra.Command, args []string) error {
|
||||
return func(_ *cobra.Command, _ []string) error {
|
||||
if check.CheckForAppUpdate {
|
||||
checkForApplicationUpdate(id)
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
// TODO: add tui element here?
|
||||
|
||||
func NewEnvironmentTask() Task {
|
||||
fn := func(ctx context.Context, resolver file.Resolver, builder sbomsync.Builder) error {
|
||||
fn := func(_ context.Context, resolver file.Resolver, builder sbomsync.Builder) error {
|
||||
release := linux.IdentifyRelease(resolver)
|
||||
if release != nil {
|
||||
builder.SetLinuxDistribution(*release)
|
||||
|
|
|
@ -108,7 +108,7 @@ func NewExecutableCatalogerTask(selection file.Selection, cfg executable.Config)
|
|||
|
||||
cat := executable.NewCataloger(cfg)
|
||||
|
||||
fn := func(ctx context.Context, resolver file.Resolver, builder sbomsync.Builder) error {
|
||||
fn := func(_ context.Context, resolver file.Resolver, builder sbomsync.Builder) error {
|
||||
accessor := builder.(sbomsync.Accessor)
|
||||
|
||||
result, err := cat.Catalog(resolver)
|
||||
|
|
|
@ -22,7 +22,7 @@ func (s sourceIdentifierAdapter) ID() artifact.ID {
|
|||
}
|
||||
|
||||
func NewRelationshipsTask(cfg cataloging.RelationshipsConfig, src source.Description) Task {
|
||||
fn := func(ctx context.Context, resolver file.Resolver, builder sbomsync.Builder) error {
|
||||
fn := func(_ context.Context, _ file.Resolver, builder sbomsync.Builder) error {
|
||||
relationship.Finalize(
|
||||
builder,
|
||||
cfg,
|
||||
|
|
|
@ -232,7 +232,7 @@ func (u UnindexedDirectory) AllLocations(ctx context.Context) <-chan file.Locati
|
|||
errWalkCanceled := fmt.Errorf("walk canceled")
|
||||
go func() {
|
||||
defer close(out)
|
||||
err := afero.Walk(u.fs, u.absPath("."), func(p string, info fs.FileInfo, err error) error {
|
||||
err := afero.Walk(u.fs, u.absPath("."), func(p string, _ fs.FileInfo, _ error) error {
|
||||
p = strings.TrimPrefix(p, u.dir)
|
||||
if p == "" {
|
||||
return nil
|
||||
|
|
|
@ -22,7 +22,7 @@ func AddSnippet(appConfig config.Application) *cobra.Command {
|
|||
Use: "add-snippet",
|
||||
Short: "capture snippets from binaries",
|
||||
Args: cobra.NoArgs,
|
||||
PreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
PreRunE: func(_ *cobra.Command, _ []string) error {
|
||||
candidates, err := internal.ListAllBinaries(appConfig)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to list binaries: %w", err)
|
||||
|
@ -44,7 +44,7 @@ func AddSnippet(appConfig config.Application) *cobra.Command {
|
|||
|
||||
return nil
|
||||
},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
name, version, _, err := inferInfoFromBinaryPath(appConfig, binaryPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to infer name and version from binary path: %w", err)
|
||||
|
|
|
@ -17,7 +17,7 @@ func Download(appConfig config.Application) *cobra.Command {
|
|||
cmd := &cobra.Command{
|
||||
Use: "download",
|
||||
Short: "download binaries [name@version ...]",
|
||||
PreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
PreRunE: func(_ *cobra.Command, args []string) error {
|
||||
if len(args) > 0 {
|
||||
for _, arg := range args {
|
||||
binaryFromImageCfg := appConfig.GetBinaryFromImage(arg, "")
|
||||
|
@ -40,7 +40,7 @@ func Download(appConfig config.Application) *cobra.Command {
|
|||
|
||||
return nil
|
||||
},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
for _, binaryFromImageCfg := range configs {
|
||||
if err := internal.DownloadFromImage(appConfig.DownloadPath, binaryFromImageCfg); err != nil {
|
||||
return err
|
||||
|
|
|
@ -19,7 +19,7 @@ func List(appConfig config.Application) *cobra.Command {
|
|||
Use: "list",
|
||||
Short: "list managed binaries and managed/unmanaged snippets",
|
||||
Args: cobra.NoArgs,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
return runList(appConfig, showPaths)
|
||||
},
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ func WriteSnippet(appConfig config.Application) *cobra.Command {
|
|||
Use: "write-snippet [binary]",
|
||||
Short: "capture snippets from binaries",
|
||||
Args: cobra.ExactArgs(1),
|
||||
PreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
PreRunE: func(_ *cobra.Command, args []string) error {
|
||||
if len(args) == 0 && (name != "" || version != "") {
|
||||
return fmt.Errorf("cannot provide name or version without a binary path")
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ func WriteSnippet(appConfig config.Application) *cobra.Command {
|
|||
|
||||
return nil
|
||||
},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
platform, err := getPlatform(binaryPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to get platform: %w", err)
|
||||
|
|
|
@ -169,7 +169,7 @@ func getLogicalKey(managedBinaryPath string) (*LogicalEntryKey, error) {
|
|||
|
||||
func allFilePaths(root string) ([]string, error) {
|
||||
var paths []string
|
||||
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
|
||||
err := filepath.Walk(root, func(path string, info os.FileInfo, _ error) error {
|
||||
if info != nil && !info.IsDir() && !strings.HasSuffix(path, ".fingerprint") {
|
||||
paths = append(paths, path)
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ type Cataloger struct {
|
|||
|
||||
func (c *Cataloger) WithParserByGlobs(parser Parser, globs ...string) *Cataloger {
|
||||
c.processor = append(c.processor,
|
||||
func(resolver file.Resolver, env Environment) []request {
|
||||
func(resolver file.Resolver, _ Environment) []request {
|
||||
var requests []request
|
||||
for _, g := range globs {
|
||||
log.WithFields("glob", g).Trace("searching for paths matching glob")
|
||||
|
@ -47,7 +47,7 @@ func (c *Cataloger) WithParserByGlobs(parser Parser, globs ...string) *Cataloger
|
|||
|
||||
func (c *Cataloger) WithParserByMimeTypes(parser Parser, types ...string) *Cataloger {
|
||||
c.processor = append(c.processor,
|
||||
func(resolver file.Resolver, env Environment) []request {
|
||||
func(resolver file.Resolver, _ Environment) []request {
|
||||
var requests []request
|
||||
log.WithFields("mimetypes", types).Trace("searching for paths matching mimetype")
|
||||
matches, err := resolver.FilesByMIMEType(types...)
|
||||
|
@ -64,7 +64,7 @@ func (c *Cataloger) WithParserByMimeTypes(parser Parser, types ...string) *Catal
|
|||
|
||||
func (c *Cataloger) WithParserByPath(parser Parser, paths ...string) *Cataloger {
|
||||
c.processor = append(c.processor,
|
||||
func(resolver file.Resolver, env Environment) []request {
|
||||
func(resolver file.Resolver, _ Environment) []request {
|
||||
var requests []request
|
||||
for _, p := range paths {
|
||||
log.WithFields("path", p).Trace("searching for path")
|
||||
|
|
|
@ -64,16 +64,16 @@ func groupIDFromJavaManifest(manifest *pkg.JavaManifest) (groupID string) {
|
|||
return groupID
|
||||
}
|
||||
|
||||
groupIDS := cpegenerate.GetManifestFieldGroupIDs(manifest, cpegenerate.PrimaryJavaManifestGroupIDFields)
|
||||
groupIDs := cpegenerate.GetManifestFieldGroupIDs(manifest, cpegenerate.PrimaryJavaManifestGroupIDFields)
|
||||
// assumes that primaryJavaManifestNameFields are ordered by priority
|
||||
if len(groupIDS) != 0 {
|
||||
return groupIDS[0]
|
||||
if len(groupIDs) != 0 {
|
||||
return groupIDs[0]
|
||||
}
|
||||
|
||||
groupIDS = cpegenerate.GetManifestFieldGroupIDs(manifest, cpegenerate.SecondaryJavaManifestGroupIDFields)
|
||||
groupIDs = cpegenerate.GetManifestFieldGroupIDs(manifest, cpegenerate.SecondaryJavaManifestGroupIDFields)
|
||||
|
||||
if len(groupIDS) != 0 {
|
||||
return groupIDS[0]
|
||||
if len(groupIDs) != 0 {
|
||||
return groupIDs[0]
|
||||
}
|
||||
|
||||
return groupID
|
||||
|
|
|
@ -177,7 +177,7 @@ func (s FileSource) FileResolver(_ Scope) (file.Resolver, error) {
|
|||
exclusionFunctions = append([]fileresolver.PathIndexVisitor{
|
||||
|
||||
// note: we should exclude these kinds of paths first before considering any other user-provided exclusions
|
||||
func(p string, info os.FileInfo, err error) error {
|
||||
func(p string, _ os.FileInfo, _ error) error {
|
||||
if p == absParentDir {
|
||||
// this is the root directory... always include it
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue