Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

fix: prevent skipping current folder if only a single file needs to be ignored (#99) #100

Merged
merged 1 commit into from
Jul 4, 2022
Merged
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
6 changes: 5 additions & 1 deletion go/pkg/apis/recognizer/language_recognizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ func GetFilePathsFromRoot(root string) ([]string, error) {
errWalk := filepath.Walk(root,
func(path string, info os.FileInfo, err error) error {
if errorIgnoreFile == nil && ignoreFile.MatchesPath(path) {
return filepath.SkipDir
if info.IsDir() {
return filepath.SkipDir
} else {
return nil
}
}
if !info.IsDir() && isFileInRoot(root, path) {
files = append([]string{path}, files...)
Expand Down