From d489d785313031bef7380e0bba45164e37e9199b Mon Sep 17 00:00:00 2001 From: Danilo Patrucco Date: Fri, 5 Jul 2024 14:43:33 -0400 Subject: [PATCH] remove extra file Signed-off-by: Danilo Patrucco --- cmd/helm/lint.go | 1 - pkg/action/lint.go | 9 +++++++++ pkg/lint/rules/ignore.go | 27 --------------------------- 3 files changed, 9 insertions(+), 28 deletions(-) delete mode 100644 pkg/lint/rules/ignore.go diff --git a/cmd/helm/lint.go b/cmd/helm/lint.go index e5b4898c8..75402f70c 100644 --- a/cmd/helm/lint.go +++ b/cmd/helm/lint.go @@ -160,4 +160,3 @@ func newLintCmd(out io.Writer) *cobra.Command { return cmd } - diff --git a/pkg/action/lint.go b/pkg/action/lint.go index ff202cec7..150768398 100644 --- a/pkg/action/lint.go +++ b/pkg/action/lint.go @@ -55,6 +55,15 @@ func (l *Lint) Run(paths []string, vals map[string]interface{}) *LintResult { return result } +func HasWarningsOrErrors(result *LintResult) bool { + for _, msg := range result.Messages { + if msg.Severity > support.InfoSev { + return true + } + } + return len(result.Errors) > 0 +} + func lintChart(path string, vals map[string]interface{}, namespace string, kubeVersion *chartutil.KubeVersion, ignoreFilePath string) (support.Linter, error) { var chartPath string linter := support.Linter{} diff --git a/pkg/lint/rules/ignore.go b/pkg/lint/rules/ignore.go deleted file mode 100644 index df50997bb..000000000 --- a/pkg/lint/rules/ignore.go +++ /dev/null @@ -1,27 +0,0 @@ -package rules - -import ( - "bufio" - "os" - "strings" -) - -// ParseIgnoreFile reads and parses the .helmlintignore file, returning a list of patterns -func ParseIgnoreFile(filePath string) ([]string, error) { - var patterns []string - file, err := os.Open(filePath) - if err != nil { - return nil, err - } - defer file.Close() - - scanner := bufio.NewScanner(file) - for scanner.Scan() { - line := strings.TrimSpace(scanner.Text()) - if line != "" && !strings.HasPrefix(line, "#") { // Ignore comments and empty lines - patterns = append(patterns, line) - } - } - - return patterns, scanner.Err() -}