mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 21:24:21 +01:00
Code cleaning (#240)
This commit is contained in:
1 parent
ca18e8e2f6
commit
6d980b4eab
11 files changed
+244
-200
No files matched your search
@@ -5,11 +5,11 @@ import (
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
gitleaks "github.com/zricethezav/gitleaks/src"
|
||||
"github.com/zricethezav/gitleaks/src"
|
||||
)
|
||||
|
||||
func main() {
|
||||
report, err := gitleaks.Run(gitleaks.ParseOpts())
|
||||
_, err := gitleaks.Run(gitleaks.ParseOpts())
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "whitelisted") {
|
||||
log.Info(err.Error())
|
||||
@@ -18,11 +18,4 @@ func main() {
|
||||
log.Error(err)
|
||||
os.Exit(gitleaks.ErrExit)
|
||||
}
|
||||
|
||||
if len(report.Leaks) != 0 {
|
||||
log.Warnf("%d leaks detected. %d commits inspected in %s", len(report.Leaks), report.Commits, report.Duration)
|
||||
os.Exit(gitleaks.LeakExit)
|
||||
} else {
|
||||
log.Infof("%d leaks detected. %d commits inspected in %s", len(report.Leaks), report.Commits, report.Duration)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user