Parcourir la source

remove godoc text filtering (#763)

Zachary Rice il y a 4 ans
Parent
commit
991223abab
2 fichiers modifiés avec 0 ajouts et 10 suppressions
  1. 0 5
      detect/files.go
  2. 0 5
      detect/git.go

+ 0 - 5
detect/files.go

@@ -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

+ 0 - 5
detect/git.go

@@ -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") {