feat: repo health check (#16) #17

Merged
张泊明518370910136 merged 37 commits from file_check into master 2024-09-11 20:09:27 +08:00
Showing only changes of commit 9937bb8b1a - Show all commits

View File

@ -54,29 +54,23 @@ func getForbiddens(root string, fileList []string, localList string) ([]string,
} }
if info.IsDir() { if info.IsDir() {
switch { if info.Name() == ".git" || info.Name() == ".gitea" || info.Name() == "ci" || (localList != "" && inString(info.Name(), dirs)) {
case info.Name() == ".git" || info.Name() == ".gitea" || info.Name() == "ci":
return filepath.SkipDir return filepath.SkipDir
case localList != "": }
if inString(info.Name(), dirs) { } else {
return filepath.SkipDir match := false
for _, regex := range regexList {
if regex.MatchString(info.Name()) {
match = true
break
} }
default: }
return nil
if !match {
matches = append(matches, path)
} }
} }
match := false
for _, regex := range regexList {
if regex.MatchString(info.Name()) {
match = true
break
}
}
if !match {
matches = append(matches, path)
}
return nil return nil
}) })