Skip to content

Commit

Permalink
exclusion rule fix (#34)
Browse files Browse the repository at this point in the history
Exclusion rule was getting applied only to the name of the file. Made a
change to get it applied for the path as well.
  • Loading branch information
pandurangpatil authored Apr 19, 2024
1 parent 20c9d91 commit acc4c80
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ func processRequest(out string, inputPath string, excludeFiles string) {
return err
}
if !info.IsDir() && (strings.HasSuffix(info.Name(), ".go") || strings.HasSuffix(info.Name(), ".mod")) {
matched, _ := regexp.MatchString(excludeFiles, info.Name())
if excludeFiles == "" || matched == false {
fileMatched, _ := regexp.MatchString(excludeFiles, info.Name())
pathMatched, _ := regexp.MatchString(excludeFiles, path)
if excludeFiles == "" || (fileMatched == false && pathMatched == false) {
totalSentForProcessing++
go processFile(out, inputPath, path, info, resultErrChan, sem)
}
Expand Down

0 comments on commit acc4c80

Please sign in to comment.