Pārlūkot izejas kodu

Bug 553 global allowlist (#554)

* add global file check

* rm whitespace
Zachary Rice 4 gadi atpakaļ
vecāks
revīzija
12d276acd7
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. 6 0
      scan/unstaged.go

+ 6 - 0
scan/unstaged.go

@@ -184,6 +184,12 @@ func (us *UnstagedScanner) Scan() (Report, error) {
 				}
 				}
 			}
 			}
 
 
+			// Check if file is allow listed
+			if us.cfg.Allowlist.FileAllowed(filepath.Base(filename)) ||
+				us.cfg.Allowlist.PathAllowed(filename) {
+				continue
+			}
+
 			dmp := diffmatchpatch.New()
 			dmp := diffmatchpatch.New()
 			diffs := dmp.DiffMain(prevFileContents, currFileContents, false)
 			diffs := dmp.DiffMain(prevFileContents, currFileContents, false)
 			prettyDiff := diffPrettyText(diffs)
 			prettyDiff := diffPrettyText(diffs)