|
@@ -157,6 +157,18 @@ func (repo *Repo) AuditUncommitted() error {
|
|
|
|
|
|
|
|
if fileMatched(filename, repo.config.Whitelist.File) {
|
|
if fileMatched(filename, repo.config.Whitelist.File) {
|
|
|
log.Debugf("whitelisted file found, skipping audit of file: %s", filename)
|
|
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 {
|
|
} else {
|
|
|
dmp := diffmatchpatch.New()
|
|
dmp := diffmatchpatch.New()
|
|
|
diffs := dmp.DiffMain(prevFileContents, currFileContents, false)
|
|
diffs := dmp.DiffMain(prevFileContents, currFileContents, false)
|