mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 20:54:22 +01:00
Removing base scanner (#477)
This commit is contained in:
1 parent
7db08bfd90
commit
65a91ae976
8 files changed
+86
-78
No files matched your search
+11
-7
@@ -2,11 +2,14 @@ package scan
|
||||
|
||||
import (
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/zricethezav/gitleaks/v7/config"
|
||||
"github.com/zricethezav/gitleaks/v7/options"
|
||||
)
|
||||
|
||||
// CommitsScanner is a commit scanner
|
||||
type CommitsScanner struct {
|
||||
BaseScanner
|
||||
opts options.Options
|
||||
cfg config.Config
|
||||
|
||||
repo *git.Repository
|
||||
repoName string
|
||||
@@ -14,12 +17,13 @@ type CommitsScanner struct {
|
||||
}
|
||||
|
||||
// NewCommitsScanner creates and returns a commits scanner, notice the 's' in commits
|
||||
func NewCommitsScanner(base BaseScanner, repo *git.Repository, commits []string) *CommitsScanner {
|
||||
func NewCommitsScanner(opts options.Options, cfg config.Config, repo *git.Repository, commits []string) *CommitsScanner {
|
||||
return &CommitsScanner{
|
||||
BaseScanner: base,
|
||||
repo: repo,
|
||||
commits: commits,
|
||||
repoName: getRepoName(base.opts),
|
||||
opts: opts,
|
||||
cfg: cfg,
|
||||
repo: repo,
|
||||
commits: commits,
|
||||
repoName: getRepoName(opts),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +35,7 @@ func (css *CommitsScanner) Scan() (Report, error) {
|
||||
if err != nil {
|
||||
return scannerReport, nil
|
||||
}
|
||||
cs := NewCommitScanner(css.BaseScanner, css.repo, c)
|
||||
cs := NewCommitScanner(css.opts, css.cfg, css.repo, c)
|
||||
commitReport, err := cs.Scan()
|
||||
if err != nil {
|
||||
return scannerReport, err
|
||||
|
||||
Reference in new issue
Block a user