Bug fix on isValidFile

This commit is contained in:
Samuel Hawksby-Robinson 2021-03-05 23:24:36 +00:00
parent 2b438d3578
commit 2df33fe301
No known key found for this signature in database
GPG Key ID: 64CF99D4A64A1205
1 changed files with 5 additions and 4 deletions

View File

@ -135,16 +135,17 @@ func (tf *TodoFinder) FindInDir(dir string) error {
}
func (tf TodoFinder) isValidFile(name string) bool {
valid := false
for _, ft := range tf.repo.FileTypes {
ftl := len(ft) + 1
if len(name) < ftl {
return false
}
last := name[ftl:]
valid = last == "."+ft
last := name[len(name)-ftl:]
if last == "."+ft {
return true
}
}
return valid
return false
}
func (tf TodoFinder) buildRegexPattern() string {