From 12d276acd73ef6356d0896ade061d95ea0c9a14e Mon Sep 17 00:00:00 2001 From: Zachary Rice Date: Thu, 22 Apr 2021 18:07:07 -0400 Subject: [PATCH] Bug 553 global allowlist (#554) * add global file check * rm whitespace --- scan/unstaged.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scan/unstaged.go b/scan/unstaged.go index 6468e810..dc199da3 100644 --- a/scan/unstaged.go +++ b/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() diffs := dmp.DiffMain(prevFileContents, currFileContents, false) prettyDiff := diffPrettyText(diffs)