Commit 2521ce7b authored by Miguel Ángel Martínez Triviño's avatar Miguel Ángel Martínez Triviño Committed by GitHub

Merge pull request #1019 from ebraminio/strictflag

Add a strict flag to helm lint
parents 1d718d79 107821f9
......@@ -47,7 +47,10 @@ var lintCommand = &cobra.Command{
RunE: lintCmd,
}
var flagStrict bool
func init() {
lintCommand.Flags().BoolVarP(&flagStrict, "strict", "", false, "fail on lint warnings")
RootCommand.AddCommand(lintCommand)
}
......@@ -59,6 +62,13 @@ func lintCmd(cmd *cobra.Command, args []string) error {
paths = args
}
var lowestTolerance int
if flagStrict {
lowestTolerance = support.WarningSev
} else {
lowestTolerance = support.ErrorSev
}
var total int
var failures int
for _, path := range paths {
......@@ -77,7 +87,7 @@ func lintCmd(cmd *cobra.Command, args []string) error {
}
total = total + 1
if linter.HighestSeverity >= support.ErrorSev {
if linter.HighestSeverity >= lowestTolerance {
failures = failures + 1
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment