Avoid extracting joblib archives #2334
style.yaml
on: pull_request
check yr compile
14s
check yr fmt
17s
check gofmt
26s
check goimports
30s
golangci-lint
41s
Annotations
15 errors and 2 warnings
check gofmt:
pkg/archive/archive.go#L1
Please run gofmt -s.
diff --git a/pkg/archive/archive.go b/pkg/archive/archive.go
index 4ac4b0d..8cb036c 100644
--- a/pkg/archive/archive.go
+++ b/pkg/archive/archive.go
@@ -40,8 +40,8 @@ func extractNestedArchive(
isArchive = true
case programkind.ArchiveMap[programkind.GetExt(f)]:
isArchive = true
- default:
- isArchive = false
+ default:
+ isArchive = false
}
//nolint:nestif // ignore complexity of 8
@@ -58,8 +58,8 @@ func extractNestedArchive(
if err != nil {
return fmt.Errorf("failed to determine file type: %w", err)
}
-
- switch {
+
+ switch {
case ft != nil && ft.MIME == "application/x-upx":
extract = ExtractUPX
case ft != nil && ft.MIME == "application/zlib":
@@ -114,8 +114,8 @@ func ExtractArchiveToTempDir(ctx context.Context, path string) (string, error) {
if err != nil {
return "", fmt.Errorf("failed to determine file type: %w", err)
}
-
- var isArchive bool
+
+ var isArchive bool
ft, err := programkind.File(f)
if err != nil {
return fmt.Errorf("failed to determine file type: %w", err)
@@ -124,15 +124,15 @@ func ExtractArchiveToTempDir(ctx context.Context, path string) (string, error) {
switch {
case ft != nil && ft.MIME == "application/x-upx":
isArchive = true
- extract = ExtractUPX
+ extract = ExtractUPX
case ft != nil && ft.MIME == "application/zlib":
isArchive = true
- extract = ExtractZlib
+ extract = ExtractZlib
case programkind.ArchiveMap[programkind.GetExt(f)]:
isArchive = true
- extract = ExtractionMethod(programkind.GetExt(path))
- default:
- isArchive = false
+ extract = ExtractionMethod(programkind.GetExt(path))
+ default:
+ isArchive = false
}
if !isArchive || extract == nil {
|
check gofmt
Process completed with exit code 1.
|
check goimports:
pkg/archive/archive.go#L1
Please run goimports.
diff --git a/pkg/archive/archive.go b/pkg/archive/archive.go
index 4ac4b0d..8cb036c 100644
--- a/pkg/archive/archive.go
+++ b/pkg/archive/archive.go
@@ -40,8 +40,8 @@ func extractNestedArchive(
isArchive = true
case programkind.ArchiveMap[programkind.GetExt(f)]:
isArchive = true
- default:
- isArchive = false
+ default:
+ isArchive = false
}
//nolint:nestif // ignore complexity of 8
@@ -58,8 +58,8 @@ func extractNestedArchive(
if err != nil {
return fmt.Errorf("failed to determine file type: %w", err)
}
-
- switch {
+
+ switch {
case ft != nil && ft.MIME == "application/x-upx":
extract = ExtractUPX
case ft != nil && ft.MIME == "application/zlib":
@@ -114,8 +114,8 @@ func ExtractArchiveToTempDir(ctx context.Context, path string) (string, error) {
if err != nil {
return "", fmt.Errorf("failed to determine file type: %w", err)
}
-
- var isArchive bool
+
+ var isArchive bool
ft, err := programkind.File(f)
if err != nil {
return fmt.Errorf("failed to determine file type: %w", err)
@@ -124,15 +124,15 @@ func ExtractArchiveToTempDir(ctx context.Context, path string) (string, error) {
switch {
case ft != nil && ft.MIME == "application/x-upx":
isArchive = true
- extract = ExtractUPX
+ extract = ExtractUPX
case ft != nil && ft.MIME == "application/zlib":
isArchive = true
- extract = ExtractZlib
+ extract = ExtractZlib
case programkind.ArchiveMap[programkind.GetExt(f)]:
isArchive = true
- extract = ExtractionMethod(programkind.GetExt(path))
- default:
- isArchive = false
+ extract = ExtractionMethod(programkind.GetExt(path))
+ default:
+ isArchive = false
}
if !isArchive || extract == nil {
|
check goimports
Process completed with exit code 1.
|
check goimports
Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
|
golangci-lint:
pkg/action/scan.go#L20
could not import github.com/chainguard-dev/malcontent/pkg/archive (-: # github.com/chainguard-dev/malcontent/pkg/archive
|
golangci-lint:
pkg/archive/archive.go#L119
no new variables on left side of :=
|
golangci-lint:
pkg/archive/archive.go#L119
undefined: f
|
golangci-lint:
pkg/archive/archive.go#L121
not enough return values
|
golangci-lint:
pkg/archive/archive.go#L131
undefined: f) (typecheck)
|
golangci-lint:
pkg/archive/archive.go#L119
no new variables on left side of :=
|
golangci-lint:
pkg/archive/archive.go#L119
undefined: f
|
golangci-lint:
pkg/archive/archive.go#L121
not enough return values
|
golangci-lint:
pkg/archive/archive.go#L131
undefined: f (typecheck)
|
golangci-lint
issues found
|
check yr compile
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
check yr fmt
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
diff
|
678 Bytes |
|