cloudfoundry-incubator / kubecf

Cloud Foundry on Kubernetes
Apache License 2.0
115 stars 62 forks source link

Improve sample values output: Block-oriented comments #907

Open mook-as opened 4 years ago

mook-as commented 4 years ago

Is your feature request related to a problem? Please describe. We currently have a sample values generator from #857 that comments out things that are not required for the user:

features:
  eirini:
    enabled: false
  # ingress:
    # enabled: false
    # tls:
      # crt: ~
      # key: ~
    # annotations: {}
    # labels: {}

Describe the solution you'd like

It would be nice if the comment characters (#) were lined up in one column so that on column-editing-capable editors they can be uncommented easily. Something like:

features:
  eirini:
    enabled: false
  # ingress:
  #   enabled: false
  #   tls:
  #     crt: ~
  #     key: ~
  #   annotations: {}
  #   labels: {}

Describe alternatives you've considered

The easy path would be to just make all the #s be on the first column; that doesn't look as nice though (especially if there's a single deeply-nested required value).

We probably want to think about how to deal with actual comments in there too. Do we double-comment? Leave it along (and have jagged comment starts)? Move the comment mark around (and make uncommenting annoying)?

The current behaviour was the easiest to implement quickly.

jandubois commented 4 years ago

One problem I see with putting the # char in a lower column is that it becomes more ambiguous if the commented lines are indented by the comments, or if the # just replaced a space, i.e. does

features:
  eirini:
    enabled: false
  # ingress:
  #   enabled: false

mean

features:
  eirini:
    enabled: false
  ingress:
    enabled: false

or

features:
  eirini:
    enabled: false
    ingress:
      enabled: false

Hmm, I guess it is ambiguous whatever you do. 😦 Suggestions welcome!