Skip to content

Commit

Permalink
Merge pull request #52 from outofrange/fix/45-strip-helm-docs-tags
Browse files Browse the repository at this point in the history
fix(schema): also remove helm-docs tags when not dontRemoveHelmDocsPrefix
  • Loading branch information
dadav authored Aug 31, 2024
2 parents 0d5ac88 + ebebdc6 commit cff876f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,11 @@ func YamlToSchema(
log.Fatalf("Error while parsing comment of key %s: %v", keyNode.Value, err)
}
if !dontRemoveHelmDocsPrefix {
// remove all lines containing helm-docs @tags, like @ignored, or one of those:
// https://github.com/norwoodj/helm-docs/blob/v1.14.2/pkg/helm/chart_info.go#L18-L24
helmDocsTagsRemover := regexp.MustCompile(`(?ms)(\r\n|\r|\n)?\s*@\w+(\s+--\s)?[^\n\r]*`)
description = helmDocsTagsRemover.ReplaceAllString(description, "")

prefixRemover := regexp.MustCompile(`(?m)^--\s?`)
description = prefixRemover.ReplaceAllString(description, "")
}
Expand Down

0 comments on commit cff876f

Please sign in to comment.