diff --git a/audit/repo.go b/audit/repo.go index bcea1f50..68dfc27b 100644 --- a/audit/repo.go +++ b/audit/repo.go @@ -157,6 +157,18 @@ func (repo *Repo) AuditUncommitted() error { if fileMatched(filename, repo.config.Whitelist.File) { log.Debugf("whitelisted file found, skipping audit of file: %s", filename) + } else if fileMatched(filename, repo.config.FileRegex) { + repo.Manager.SendLeaks(manager.Leak{ + Line: "N/A", + Offender: filename, + Commit: c.Hash.String(), + Repo: repo.Name, + Rule: "file regex matched" + repo.config.FileRegex.String(), + Author: c.Author.Name, + Email: c.Author.Email, + Date: c.Author.When, + File: filename, + }) } else { dmp := diffmatchpatch.New() diffs := dmp.DiffMain(prevFileContents, currFileContents, false)