feat: repo health check (#16) #17
|
@ -54,18 +54,10 @@ func getForbiddens(root string, fileList []string, localList string) ([]string,
|
|||
}
|
||||
|
||||
if info.IsDir() {
|
||||
switch {
|
||||
case info.Name() == ".git" || info.Name() == ".gitea" || info.Name() == "ci":
|
||||
return filepath.SkipDir
|
||||
case localList != "":
|
||||
if inString(info.Name(), dirs) {
|
||||
if info.Name() == ".git" || info.Name() == ".gitea" || info.Name() == "ci" || (localList != "" && inString(info.Name(), dirs)) {
|
||||
return filepath.SkipDir
|
||||
}
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
match := false
|
||||
for _, regex := range regexList {
|
||||
if regex.MatchString(info.Name()) {
|
||||
|
@ -77,6 +69,8 @@ func getForbiddens(root string, fileList []string, localList string) ([]string,
|
|||
if !match {
|
||||
matches = append(matches, path)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user