Skip to content

Commit

Permalink
remove godoc text filtering (gitleaks#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
zricethezav authored Jan 7, 2022
1 parent 801d44a commit 991223a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
5 changes: 0 additions & 5 deletions detect/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions detect/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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") {
Expand Down

0 comments on commit 991223a

Please sign in to comment.