Details

      Description

      From Hashimoto

      Hi Hugo and Alan,
       
      I have some more requests for SF changes in YAML files from conversations with BChan & Peter.
       
      Can we add a couple of more rules to the YAML source formatter.
       
      1.  If there is a "---" that divides 2 different YAML trees in 1 file, we want to make sure there is an additional space before and after that line.
       

      See the difference between these 2 files as an example:
      Bad Example (No Spaces)
      Good Example (Extra Spaces)
      The reason for this rule is so that we can distinguish between different YAML trees.

       
      2. Extra lines between different root YAML trees should NOT be allowed.
       

      See the difference between these 2 files as an example:
      Bad Example (No Spaces)
      Good Example (Extra Spaces)
      The reason for this rule is so that we can see that root YAML entries are connected.

      Actually one more rule.
       
      3. For the {{ ... }} syntax, can we make sure there is always 1 space after the opening braces and before the closing braces?  The only exception being a "-".
        

      Here is what bad syntax will look like:
      {{$.Values.some.value}}
      {{    range $nodeName := $.Values.job.env.nodeNames  }}
      {{-end-}}
      
      Here is what good syntax will look like:
      {{ $.Values.some.value }}
      {{ range $nodeName := $.Values.job.env.nodeNames }}
      {{- end -}}
      

      The reason for this update is to have consistent formatting.
      We choses having a space to match the JSP spacing rules.

       
      Please let me know if you have any questions about this rule as well.
       
      Thanks again!
       
      -Hashi

        Attachments

          Activity

            People

            • Assignee:
              hugo.huijser Hugo Huijser
              Reporter:
              alan.huang Alan Huang
              Recent user:
              Enterprise Release HU
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                7.0.X
                7.1.X
                7.2.X
                Master