mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
Removing limiting line/offender length (#470)
This commit is contained in:
1 parent
81b3a6e279
commit
eb31190f31
3 files changed
+5
-22
No files matched your search
+5
-12
@@ -164,11 +164,11 @@ func checkRules(scanner BaseScanner, commit *object.Commit, repoName, filePath,
|
||||
leak := report.Leak{
|
||||
LineNumber: defaultLineNumber,
|
||||
Line: "",
|
||||
Offender: limitLen("Filename/path offender: " + filename),
|
||||
Offender: "Filename/path offender: " + filename,
|
||||
Commit: commit.Hash.String(),
|
||||
Repo: repoName,
|
||||
RepoURL: scanner.opts.RepoURL,
|
||||
Message: limitLen(commit.Message),
|
||||
Message: commit.Message,
|
||||
Rule: rule.Description,
|
||||
Author: commit.Author.Name,
|
||||
Email: commit.Author.Email,
|
||||
@@ -217,12 +217,12 @@ func checkRules(scanner BaseScanner, commit *object.Commit, repoName, filePath,
|
||||
|
||||
leak := report.Leak{
|
||||
LineNumber: lineNumber,
|
||||
Line: limitLen(line),
|
||||
Offender: limitLen(offender),
|
||||
Line: line,
|
||||
Offender: offender,
|
||||
Commit: commit.Hash.String(),
|
||||
Repo: repoName,
|
||||
RepoURL: scanner.opts.RepoURL,
|
||||
Message: limitLen(commit.Message),
|
||||
Message: commit.Message,
|
||||
Rule: rule.Description,
|
||||
Author: commit.Author.Name,
|
||||
Email: commit.Author.Email,
|
||||
@@ -241,13 +241,6 @@ func checkRules(scanner BaseScanner, commit *object.Commit, repoName, filePath,
|
||||
return leaks
|
||||
}
|
||||
|
||||
func limitLen(str string) string {
|
||||
if len(str) > 200 {
|
||||
return str[0:maxLineLen-1] + "..."
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
func logLeak(leak report.Leak, redact bool) {
|
||||
if redact {
|
||||
leak = report.RedactLeak(leak)
|
||||
|
||||
Reference in new issue
Block a user