mirror of
https://github.com/veggiemonk/awesome-docker.git
synced 2026-07-02 03:20:32 +02:00
feat: add prune subcommand, drop archived/stale entries (#1441)
* feat: add prune subcommand, drop archived/stale entries, add container-explorer Add a new `awesome-docker prune` subcommand that removes README entries whose repository health status matches a configurable set (default: archived,stale). URLs are read from the local health cache, or from a markdown report file via --from-report when the cache is outdated. Apply it against the issue #1439 health report to remove 5 entries that survived the recent reorg: stitchocker, docker-consul, blockbridge-docker-volume, docker-explorer, dockdash. Add google/container-explorer in the Security section as the actively maintained successor to the now-archived google/docker-explorer. Co-Authored-By: Claude <noreply@anthropic.com> * golangci-lint config * fix: address golangci-lint findings Fixes errcheck on bufio.Writer.WriteString, gocritic rangeValCopy via indexed loops with pointer locals, gosec G703 on user-supplied CLI output path, noctx by switching to exec.CommandContext with a timeout in the TUI url opener, prealloc in the scorer test, plus fieldalignment struct reorders and golines line breaks from --fix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,9 @@ import (
|
||||
// by [@author](url), by [@author][ref], by @author
|
||||
//
|
||||
// Also handles "Created by", "Maintained by" etc.
|
||||
var attributionRe = regexp.MustCompile(`\s+(?:(?:[Cc]reated|[Mm]aintained|[Bb]uilt)\s+)?by\s+\[@[^\]]+\](?:\([^)]*\)|\[[^\]]*\])\.?$`)
|
||||
var attributionRe = regexp.MustCompile(
|
||||
`\s+(?:(?:[Cc]reated|[Mm]aintained|[Bb]uilt)\s+)?by\s+\[@[^\]]+\](?:\([^)]*\)|\[[^\]]*\])\.?$`,
|
||||
)
|
||||
|
||||
// bareAttributionRe matches: by @author at end of line (no link).
|
||||
var bareAttributionRe = regexp.MustCompile(`\s+by\s+@\w+\.?$`)
|
||||
@@ -136,13 +138,19 @@ func FixFile(path string) (int, error) {
|
||||
|
||||
w := bufio.NewWriter(out)
|
||||
for i, line := range lines {
|
||||
w.WriteString(line)
|
||||
if _, err := w.WriteString(line); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if i < len(lines)-1 {
|
||||
w.WriteString("\n")
|
||||
if _, err := w.WriteString("\n"); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
}
|
||||
// Preserve trailing newline if original had one
|
||||
w.WriteString("\n")
|
||||
if _, err := w.WriteString("\n"); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return fixCount, w.Flush()
|
||||
}
|
||||
|
||||
@@ -218,11 +226,17 @@ func SortFile(path string) (int, error) {
|
||||
|
||||
w := bufio.NewWriter(out)
|
||||
for i, line := range lines {
|
||||
w.WriteString(line)
|
||||
if _, err := w.WriteString(line); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if i < len(lines)-1 {
|
||||
w.WriteString("\n")
|
||||
if _, err := w.WriteString("\n"); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
}
|
||||
w.WriteString("\n")
|
||||
if _, err := w.WriteString("\n"); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return fixCount, w.Flush()
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ const (
|
||||
// Issue is a single lint problem found.
|
||||
type Issue struct {
|
||||
Rule Rule
|
||||
Message string
|
||||
Severity Severity
|
||||
Line int
|
||||
Message string
|
||||
}
|
||||
|
||||
func (i Issue) String() string {
|
||||
@@ -79,7 +79,11 @@ func CheckSorted(entries []parser.Entry) []Issue {
|
||||
Rule: RuleSorted,
|
||||
Severity: SeverityError,
|
||||
Line: entries[i].Line,
|
||||
Message: fmt.Sprintf("%q should come before %q (alphabetical order)", entries[i].Name, entries[i-1].Name),
|
||||
Message: fmt.Sprintf(
|
||||
"%q should come before %q (alphabetical order)",
|
||||
entries[i].Name,
|
||||
entries[i-1].Name,
|
||||
),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user