Compare commits

...
1 Commits
Author SHA1 Message Date
Zachary Rice 991223abab remove godoc text filtering (#763) 2022-01-07 10:59:51 -06:00
2 changed files with 0 additions and 10 deletions

No files matched your search

-5
View File
@@ -7,7 +7,6 @@ import (
"sync"
"golang.org/x/sync/errgroup"
godocutil "golang.org/x/tools/godoc/util"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/report"
@@ -50,10 +49,6 @@ func FromFiles(source string, cfg config.Config, outputOptions Options) ([]repor
if err != nil {
return err
}
if !godocutil.IsText(b) {
return nil
}
fis := DetectFindings(cfg, b, p, "")
for _, fi := range fis {
// need to add 1 since line counting starts at 1
-5
View File
@@ -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") {