chore: clean up linting configuration (#1343)

This commit is contained in:
Christopher Angelo Phillips
2022-11-16 16:28:09 +00:00
committed by GitHub
parent f8be64d312
commit 0774ad15e2
31 changed files with 67 additions and 50 deletions
@@ -1,6 +1,8 @@
package rust
import (
"errors"
rustaudit "github.com/microsoft/go-rustaudit"
"github.com/anchore/syft/internal/log"
@@ -42,7 +44,7 @@ func parseAuditBinaryEntry(reader unionreader.UnionReader, filename string) []ru
versionInfo, err := rustaudit.GetDependencyInfo(r)
if err != nil {
if err == rustaudit.ErrNoRustDepInfo {
if errors.Is(err, rustaudit.ErrNoRustDepInfo) {
// since the cataloger can only select executables and not distinguish if they are a Rust-compiled
// binary, we should not show warnings/logs in this case.
return nil
+2 -2
View File
@@ -21,13 +21,13 @@ type cargoLockFile struct {
func parseCargoLock(_ source.FileResolver, _ *generic.Environment, reader source.LocationReadCloser) ([]pkg.Package, []artifact.Relationship, error) {
tree, err := toml.LoadReader(reader)
if err != nil {
return nil, nil, fmt.Errorf("unable to load Cargo.lock for parsing: %v", err)
return nil, nil, fmt.Errorf("unable to load Cargo.lock for parsing: %w", err)
}
m := cargoLockFile{}
err = tree.Unmarshal(&m)
if err != nil {
return nil, nil, fmt.Errorf("unable to parse Cargo.lock: %v", err)
return nil, nil, fmt.Errorf("unable to parse Cargo.lock: %w", err)
}
var pkgs []pkg.Package