Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pkg/cli/audit_report_analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ func generateFindings(processedRun ProcessedRun, metrics MetricsData, errors []E

// Missing tool findings
if len(processedRun.MissingTools) > 0 {
toolNames := sliceutil.Map(processedRun.MissingTools[:min(3, len(processedRun.MissingTools))], func(t MissingToolReport) string { return t.Tool })
toolNames := sliceutil.Map(
processedRun.MissingTools[:min(3, len(processedRun.MissingTools))],
func(t MissingToolReport) string { return t.Tool },
)
desc := "Missing tools: " + strings.Join(toolNames, ", ")
if len(processedRun.MissingTools) > 3 {
desc += fmt.Sprintf(" (and %d more)", len(processedRun.MissingTools)-3)
Expand Down
3 changes: 2 additions & 1 deletion pkg/fileutil/tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package fileutil
import (
"archive/tar"
"bytes"
"errors"
"fmt"
"io"

Expand All @@ -20,7 +21,7 @@ func ExtractFileFromTar(data []byte, path string) ([]byte, error) {
entriesScanned := 0
for {
header, err := tr.Next()
if err == io.EOF {
if errors.Is(err, io.EOF) {
tarLog.Printf("File not found in tar archive after scanning %d entries: %s", entriesScanned, path)
break
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/parser/schema_utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ func filterIgnoredFields(frontmatter map[string]any) map[string]any {
filtered := make(map[string]any)
for key, value := range frontmatter {
// Skip ignored fields
ignored := slices.Contains(constants.IgnoredFrontmatterFields, key)
if ignored {
if slices.Contains(constants.IgnoredFrontmatterFields, key) {
schemaUtilitiesLog.Printf("Removing ignored frontmatter field: %s", key)
} else {
filtered[key] = value
Expand Down
Loading