Pretty output (#973)

pretty output
This commit is contained in:
Zachary Rice authored and GitHub committed 2022-09-04 08:58:57 -05:00
1 parent 7d9dd260f4
commit 96eed6aa0f
12 files changed
+134 -15

No files matched your search

+5
View File
@@ -204,6 +204,10 @@ func (d *Detector) detectRule(fragment Fragment, rule config.Rule) []report.Find
// value is set for this rule
loc := location(fragment, matchIndex)
if matchIndex[1] > loc.endLineIndex {
loc.endLineIndex = matchIndex[1]
}
finding := report.Finding{
Description: rule.Description,
File: fragment.FilePath,
@@ -215,6 +219,7 @@ func (d *Detector) detectRule(fragment Fragment, rule config.Rule) []report.Find
Secret: secret,
Match: secret,
Tags: rule.Tags,
Line: fragment.Raw[loc.startLineIndex:loc.endLineIndex],
}
if strings.Contains(fragment.Raw[loc.startLineIndex:loc.endLineIndex],