Browse Source

ignore empty files (#965)

Zachary Rice 3 years ago
parent
commit
e47867d802
1 changed files with 3 additions and 0 deletions
  1. 3 0
      detect/detect.go

+ 3 - 0
detect/detect.go

@@ -363,6 +363,9 @@ func (d *Detector) DetectFiles(source string) ([]report.Finding, error) {
 				if fInfo.Name() == ".git" && fInfo.IsDir() {
 					return filepath.SkipDir
 				}
+				if fInfo.Size() == 0 {
+					return nil
+				}
 				if fInfo.Mode().IsRegular() {
 					paths <- path
 				}