|
|
@@ -9,7 +9,6 @@ import (
|
|
|
"github.com/rs/zerolog/log"
|
|
|
"github.com/zricethezav/gitleaks/v8/config"
|
|
|
"github.com/zricethezav/gitleaks/v8/report"
|
|
|
- godocutil "golang.org/x/tools/godoc/util"
|
|
|
)
|
|
|
|
|
|
// FromGit accepts a gitdiff.File channel (structure output from `git log -p`) and a configuration
|
|
|
@@ -58,10 +57,6 @@ func FromGit(files <-chan *gitdiff.File, cfg config.Config, outputOptions Option
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
- if !godocutil.IsText([]byte(tf.Raw(gitdiff.OpAdd))) {
|
|
|
- continue
|
|
|
- }
|
|
|
-
|
|
|
for _, fi := range DetectFindings(cfg, []byte(tf.Raw(gitdiff.OpAdd)), f.NewName, commitSHA) {
|
|
|
// don't add to start/end lines if finding is from a file only rule
|
|
|
if !strings.HasPrefix(fi.Match, "file detected") {
|