Allow list bugs (#484)

* fix allowlist bug
This commit is contained in:
Zachary Rice authored and GitHub committed 2020-12-09 13:21:15 -05:00
1 parent 973d74e592
commit 86cfe0848b
34 files changed
+232 -36

No files matched your search

+8 -4
View File
@@ -81,15 +81,19 @@ func (fs *FilesAtCommitScanner) Scan() (Report, error) {
for i, line := range strings.Split(content, "\n") {
for _, rule := range fs.cfg.Rules {
if rule.AllowList.FileAllowed(filepath.Base(f.Name)) ||
rule.AllowList.PathAllowed(f.Name) ||
rule.AllowList.CommitAllowed(fs.commit.Hash.String()) {
continue
}
offender := rule.Inspect(line)
if offender == "" {
continue
}
if fs.cfg.Allowlist.RegexAllowed(line) ||
rule.AllowList.FileAllowed(filepath.Base(f.Name)) ||
rule.AllowList.PathAllowed(f.Name) ||
rule.AllowList.CommitAllowed(fs.commit.Hash.String()) {
if fs.cfg.Allowlist.RegexAllowed(line) {
continue
}