chore: address lint extension review feedback

This commit is contained in:
copilot-swe-agent[bot]
2026-05-28 18:20:41 +00:00
committed by GitHub
parent 9cef15aa13
commit e161f9b28d
+8 -4
View File
@@ -64,18 +64,18 @@ func GetLinter(config *config.Config, log log.Logger) *lint.Linter {
}
func hasLocalTrustStoreMaterial(rootDir string) bool {
return hasFile(filepath.Join(rootDir, "_cosign")) ||
hasFile(filepath.Join(rootDir, "_notation", "truststore", "x509"))
return containsFiles(filepath.Join(rootDir, "_cosign")) ||
containsFiles(filepath.Join(rootDir, "_notation", "truststore", "x509"))
}
func hasFile(root string) bool {
func containsFiles(root string) bool {
stat, err := os.Stat(root)
if err != nil || !stat.IsDir() {
return false
}
hasMaterial := false
_ = filepath.WalkDir(root, func(_ string, d os.DirEntry, err error) error {
walkErr := filepath.WalkDir(root, func(_ string, d os.DirEntry, err error) error {
if err == nil && !d.IsDir() {
hasMaterial = true
}
@@ -83,5 +83,9 @@ func hasFile(root string) bool {
return nil
})
if walkErr != nil {
return false
}
return hasMaterial
}