diff --git a/pkg/lint/lint.go b/pkg/lint/lint.go index 07a31acea..630a8a014 100644 --- a/pkg/lint/lint.go +++ b/pkg/lint/lint.go @@ -1,5 +1,6 @@ package lint +// All runs all of the available linters on the given base directory. func All(basedir string) []Message { out := Chartfile(basedir) out = append(out, Templates(basedir)...) diff --git a/pkg/lint/message.go b/pkg/lint/message.go index a0acda0ca..240b6015b 100644 --- a/pkg/lint/message.go +++ b/pkg/lint/message.go @@ -2,16 +2,22 @@ package lint import "fmt" +// Severity indicatest the severity of a Message. type Severity int const ( + // UnknownSev indicates that the severity of the error is unknown, and should not stop processing. UnknownSev = iota + // WarningSev indicates that something does not meet code standards, but will likely function. WarningSev + // ErrorSev indicates that something will not likely function. ErrorSev ) +// sev matches the *Sev states. var sev = []string{"INFO", "WARNING", "ERROR"} +// Message is a linting output message type Message struct { // Severity is one of the *Sev constants Severity int diff --git a/pkg/lint/template.go b/pkg/lint/template.go index f3bb559d0..6a5760835 100644 --- a/pkg/lint/template.go +++ b/pkg/lint/template.go @@ -10,6 +10,7 @@ import ( "github.com/Masterminds/sprig" ) +// Templates lints a chart's templates. func Templates(basepath string) (messages []Message) { messages = []Message{} path := filepath.Join(basepath, "templates")