mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 07:56:36 +01:00
chore(deps): update tools to latest versions (#3121)
* chore(deps): update tools to latest versions Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * chore: update code to reflect new linter settings for error messages Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com> --------- Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com> Co-authored-by: spiffcs <32073428+spiffcs@users.noreply.github.com>
This commit is contained in:
co-authored by
spiffcs
parent
4ff60ee837
commit
4b7ae0ed3b
@@ -78,7 +78,8 @@ func findMetadataDefinitionNames(paths ...string) ([]string, error) {
|
||||
// note: 35 is a point-in-time gut check. This number could be updated if new metadata definitions are added, but is not required.
|
||||
// it is really intended to catch any major issues with the generation process that would generate, say, 0 definitions.
|
||||
if len(strNames) < 35 {
|
||||
return nil, fmt.Errorf("not enough metadata definitions found (discovered: " + fmt.Sprintf("%d", len(strNames)) + ")")
|
||||
msg := fmt.Sprintf("not enough metadata definitions found (discovered %d)", len(strNames))
|
||||
return nil, fmt.Errorf("%v", msg)
|
||||
}
|
||||
|
||||
return strNames, nil
|
||||
|
||||
@@ -68,7 +68,8 @@ func findMetadataDefinitionNames(paths ...string) ([]string, error) {
|
||||
// note: 3 is a point-in-time gut check. This number could be updated if new metadata definitions are added, but is not required.
|
||||
// it is really intended to catch any major issues with the generation process that would generate, say, 0 definitions.
|
||||
if len(strNames) < 3 {
|
||||
return nil, fmt.Errorf("not enough metadata definitions found (discovered: " + fmt.Sprintf("%d", len(strNames)) + ")")
|
||||
msg := fmt.Sprintf("not enough metadata definitions found (discovered %d)", len(strNames))
|
||||
return nil, fmt.Errorf("%v", msg)
|
||||
}
|
||||
|
||||
return strNames, nil
|
||||
|
||||
@@ -24,7 +24,7 @@ func parseConanfile(_ context.Context, _ file.Resolver, _ *generic.Environment,
|
||||
for {
|
||||
line, err := r.ReadString('\n')
|
||||
switch {
|
||||
case errors.Is(io.EOF, err):
|
||||
case errors.Is(err, io.EOF):
|
||||
return pkgs, nil, nil
|
||||
case err != nil:
|
||||
return nil, nil, fmt.Errorf("failed to parse conanfile.txt file: %w", err)
|
||||
|
||||
@@ -99,7 +99,7 @@ func parseConaninfo(_ context.Context, _ file.Resolver, _ *generic.Environment,
|
||||
for {
|
||||
line, err := r.ReadString('\n')
|
||||
switch {
|
||||
case errors.Is(io.EOF, err):
|
||||
case errors.Is(err, io.EOF):
|
||||
mainPackage := newConaninfoPackage(
|
||||
mainMetadata,
|
||||
reader.Location.WithAnnotation(pkg.EvidenceAnnotationKey, pkg.PrimaryEvidenceAnnotation),
|
||||
|
||||
@@ -28,7 +28,7 @@ func parseMixLock(_ context.Context, _ file.Resolver, _ *generic.Environment, re
|
||||
for {
|
||||
line, err := r.ReadString('\n')
|
||||
switch {
|
||||
case errors.Is(io.EOF, err):
|
||||
case errors.Is(err, io.EOF):
|
||||
return packages, nil, nil
|
||||
case err != nil:
|
||||
return nil, nil, fmt.Errorf("failed to parse mix.lock file: %w", err)
|
||||
|
||||
@@ -23,7 +23,7 @@ func parseCabalFreeze(_ context.Context, _ file.Resolver, _ *generic.Environment
|
||||
for {
|
||||
line, err := r.ReadString('\n')
|
||||
switch {
|
||||
case errors.Is(io.EOF, err):
|
||||
case errors.Is(err, io.EOF):
|
||||
return pkgs, nil, nil
|
||||
case err != nil:
|
||||
return nil, nil, fmt.Errorf("failed to parse cabal.project.freeze file: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user