Add threshold option in goreportcard-cli

This commit is contained in:
shunsuke maeda
2019-02-01 22:37:50 +09:00
parent 3ec84fb54f
commit 2f65ea8736

View File

@@ -4,6 +4,7 @@ import (
"flag"
"fmt"
"log"
"os"
"github.com/gojp/goreportcard/check"
)
@@ -11,6 +12,7 @@ import (
var (
dir = flag.String("d", ".", "Root directory of your Go application")
verbose = flag.Bool("v", false, "Verbose output")
th = flag.Float64("t", 0, "Threshold of failure command")
)
func main() {
@@ -36,4 +38,8 @@ func main() {
}
}
}
if result.Average*100 < *th {
os.Exit(1)
}
}