making good progress on tests

This commit is contained in:
zach rice committed 2019-03-28 21:28:16 -05:00
1 parent ae4542abf0
commit 4ea0c66bec
4 files changed
+149 -129

No files matched your search

+17 -2
View File
@@ -1,7 +1,22 @@
package main
import "github.com/zricethezav/gitleaks/src"
import (
"os"
log "github.com/sirupsen/logrus"
"github.com/zricethezav/gitleaks/src"
)
func main() {
gitleaks.Run(gitleaks.ParseOpts())
report, err := gitleaks.Run(gitleaks.ParseOpts())
if err != nil {
log.Fatal(err)
}
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)
}
}