duplicate leak logic includes the line in hash (#345)

This commit is contained in:
Zachary Rice authored and GitHub committed 2020-02-26 17:38:16 -05:00
1 parent c4b07f5113
commit 94cae90d1e
9 files changed
+70 -3

No files matched your search

+1 -2
View File
@@ -98,7 +98,6 @@ func shannonEntropy(data string) (entropy float64) {
return entropy
}
// Checks if the given rule has a regex
func ruleContainRegex(rule config.Rule) bool {
if rule.Regex == nil {
@@ -189,7 +188,7 @@ func InspectFile(content string, fullpath string, c *object.Commit, repo *Repo)
if isFileNameWhiteListed(filename, rule.Whitelist) || isFilePathWhiteListed(path, rule.Whitelist) {
continue
}
// If it has fileNameRegex and it doesnt match we continue to next rule
if ruleContainFileNameRegex(rule) && !fileMatched(filename, rule.FileNameRegex) {
continue