cert-manager / helm-tool

helm-tool is an internal cert-manager utility (can be broken or removed) which generates Helm docs, schema files and performs linting.
Apache License 2.0
5 stars 3 forks source link

helm-tool inject adds trailing white space to the generated markdown #26

Open wallrj opened 8 months ago

wallrj commented 8 months ago

In https://github.com/cert-manager/approver-policy/pull/383 I noticed some trailing white space added to the generated Helm README.

image

Perhaps it's deliberate, to generate markdown linebreaks, but it seems to put them in unusual places.

For example:

https://github.com/cert-manager/approver-policy/blob/e5203e235ef041994bc0b2fd1c8756c5108460cd/deploy/charts/approver-policy/values.yaml#L6-L11

  # This option makes it so that the "helm.sh/resource-policy": keep
  # annotation is added to the CRD. This will prevent Helm from uninstalling
  # the CRD when the Helm release is uninstalled.
  # WARNING: when the CRDs are removed, all cert-manager custom resources
  # (Certificates, Issuers, ...) will be removed too by the garbage collector.
  keep: true

Becomes:

https://github.com/cert-manager/approver-policy/blob/e5203e235ef041994bc0b2fd1c8756c5108460cd/deploy/charts/approver-policy/README.md#L16-L23

#### **crds.keep** ~ `bool`
> Default value:
> ```yaml
> true
> ```

This option makes it so that the "helm.sh/resource-policy": keep annotation is added to the CRD. This will prevent Helm from uninstalling the CRD when the Helm release is uninstalled. WARNING: when the CRDs are removed, all cert-manager custom resources  
(Certificates, Issuers, ...) will be removed too by the garbage collector.

Notice how WARNING line (which should be on it's own line) has been flowed in to the previous sentence. And the line break (double trailing space) has been added half way into the WARNING sentence.

image