Add file regex support (#340)

* Modified Entropy to be able to apply it on regex match or specific capture group

* Config tests

* Small fixes on entropy ranges

* Fix toml configs
Fix tests

* Start adding support for rules with filename regex

Changed how config is parsed
Created new functions to inspect files and content

* File regex working

* Fixing tests and configs

* Implemented different regex for filename and filepath

* Fix comments

* Audit tests

* Config rename vars

* Fix audit tests

* Filename offender

* Indents and code styles

* Indents and code styles

* Removing bad test repo

* Adding test repo 6 for filename and filepath tests

* global whitelist path and fixes

* Fixes on tests and new test for global whitelisting paths

* Removing unused test

* Fix comment
This commit is contained in:
Noel Algora authored and GitHub committed 2020-02-26 15:33:14 -05:00
1 parent 01d73028f8
commit c4b07f5113
71 files changed
+556 -256

No files matched your search

+1 -1
View File
@@ -161,7 +161,7 @@ func (g *Github) AuditPR() {
if f.Patch == nil {
continue
}
audit.InspectString(*f.Patch, &commitObj, repo, *f.Filename)
audit.InspectFile(*f.Patch, *f.Filename, &commitObj, repo)
}
}
page = resp.NextPage