mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 20:54:22 +01:00
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:
1 parent
cfbb600fcb
commit
6ca7a11d88
50 files changed
+1483
-1167
No files matched your search
+11
-6
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user