Skip to content

Commit

Permalink
Merge 247978f into 648e456
Browse files Browse the repository at this point in the history
  • Loading branch information
svishwanath-tw committed Sep 7, 2020
2 parents 648e456 + 247978f commit edf9867
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 256 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ detector/.talismanrc
coverage.out
coverage.txt
.talismanrc
talisman_reports/
13 changes: 11 additions & 2 deletions detector/pattern/pattern_detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,18 @@ func (detector PatternDetector) Test(comparator helpers.ChecksumCompare, current
}
}

var knownPatterns = make(map[string]*regexp.Regexp)

func replaceAllStrings(str string, pattern string) string {
re := regexp.MustCompile(fmt.Sprintf("(?i)%s", pattern))
return re.ReplaceAllString(str, "")
var pat *regexp.Regexp
var ok bool

if pat, ok = knownPatterns[pattern]; !ok {
pat = regexp.MustCompile(fmt.Sprintf("(?i)%s", pattern))
knownPatterns[pattern] = pat
}

return pat.ReplaceAllString(str, "")
}

func processAllowedPatterns(addition gitrepo.Addition, tRC *talismanrc.TalismanRC) string {
Expand Down
253 changes: 0 additions & 253 deletions talisman_reports/report.html

This file was deleted.

1 change: 0 additions & 1 deletion talisman_reports/report.json

This file was deleted.

0 comments on commit edf9867

Please sign in to comment.