Code cleaning (#240)

This commit is contained in:
Zachary Rice authored and GitHub committed 2019-07-10 10:32:51 -05:00
1 parent ca18e8e2f6
commit 6d980b4eab
11 files changed
+244 -200

No files matched your search

+2 -9
View File
@@ -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)
}
}