Add line number to report plus some other things (#409)

* Init refactor

* think i got it working

* we got em

* Updating tests

* fixing tests

* Better comments, more test fixing

* Bumping to v5

* Fixing golint messages

* Replacing usage of audit with scan in comments

* bumping go-git

* Updating to v5 in some other spots
This commit is contained in:
Zachary Rice authored and GitHub committed 2020-07-24 10:49:03 -04:00
1 parent cfbb600fcb
commit 6ca7a11d88
50 files changed
+1483 -1167

No files matched your search

+11 -6
View File
@@ -1,8 +1,9 @@
package hosts
import (
"github.com/zricethezav/gitleaks/v4/manager"
"strings"
"github.com/zricethezav/gitleaks/v5/manager"
)
const (
@@ -13,11 +14,11 @@ const (
// Host is an interface used for defining external git hosting providers like github and gitlab.
// TODO add bitbucket
type Host interface {
Audit()
AuditPR()
Scan()
ScanPR()
}
// Run kicks off a host audit. This function accepts a manager and determines what host it should audit
// Run kicks off a host scan. This function accepts a manager and determines what host it should scan
func Run(m *manager.Manager) error {
var host Host
var err error
@@ -30,10 +31,14 @@ func Run(m *manager.Manager) error {
return nil
}
if err != nil {
return err
}
if m.Opts.PullRequest != "" {
host.AuditPR()
host.ScanPR()
} else {
host.Audit()
host.Scan()
}
return err
}