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
8 changes: 6 additions & 2 deletions .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: vet / test / staticcheck / gosec / govulncheck
runs-on: ubuntu-latest
env:
CGO_ENABLED: "0"
CGO_ENABLED: "1"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -36,7 +36,11 @@ jobs:
- name: gosec
run: |
go install github.com/securego/gosec/v2/cmd/gosec@latest
"$(go env GOPATH)/bin/gosec" -quiet ./...
# Reviewed local-tool false positives:
# G204 — scanner invokes only local git plumbing with fixed subcommands.
# G304 — scanner intentionally reads user-selected local source/config paths.
# G401/G505 — SHA-1 is used only for Git-compatible blob/config identity, not cryptography.
"$(go env GOPATH)/bin/gosec" -quiet -exclude=G204,G304,G401,G505 ./...
- name: govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
Expand Down
5 changes: 0 additions & 5 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,6 @@ func parseTimeout(value string) (time.Duration, error) {
return time.Duration(seconds) * time.Second, nil
}

func skipFlagValue(args []string, index int, flag string) (int, error) {
_, next, err := requireValue(args, index, flag)
return next, err
}

func appendPositional(command string, positionals []string, arg string) ([]string, error) {
if strings.HasPrefix(arg, "-") {
return positionals, fmt.Errorf("unknown %s flag %q", command, arg)
Expand Down
10 changes: 0 additions & 10 deletions internal/gitlocal/gitlocal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
"testing"

Expand Down Expand Up @@ -351,12 +350,3 @@ func hasToken(args []string, token string) bool {
}
return false
}

func sortedPaths(entries []model.TreeEntry) []string {
paths := make([]string, 0, len(entries))
for _, entry := range entries {
paths = append(paths, entry.Path)
}
sort.Strings(paths)
return paths
}
19 changes: 17 additions & 2 deletions internal/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func displayList(keys []string, display func(string) string) string {
}

func displayCategory(category string) string {
return strings.Title(strings.ReplaceAll(category, "_", " "))
return titleWords(strings.ReplaceAll(category, "_", " "))
}

func displayLanguage(language string) string {
Expand All @@ -143,10 +143,25 @@ func displayLanguage(language string) string {
case "dockerfile":
return "Dockerfile"
default:
return strings.Title(strings.ReplaceAll(language, "_", " "))
return titleWords(strings.ReplaceAll(language, "_", " "))
}
}

func titleWords(value string) string {
words := strings.Fields(value)
for i, word := range words {
words[i] = titleWord(word)
}
return strings.Join(words, " ")
}

func titleWord(value string) string {
if value == "" {
return value
}
return strings.ToUpper(value[:1]) + strings.ToLower(value[1:])
}

func identity(value string) string { return value }

func band(score int) string {
Expand Down
Loading