File tree 1 file changed +45
-1
lines changed
content/en/docs/chart_best_practices
1 file changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,25 @@ as the template names are automatically defined as per this best practice.
49
49
50
50
## Formatting Templates
51
51
52
- Templates should be indented using _ two spaces_ (never tabs).
52
+ Templates should align with associated content.
53
+
54
+ Correct:
55
+
56
+ ``` yaml
57
+ myList :
58
+ {{- range .Values.elements }}
59
+ - {{ . }}
60
+ {{- end }}
61
+ ```
62
+
63
+ Incorrect:
64
+
65
+ ``` yaml
66
+ myList :
67
+ {{- range .Values.elements }}
68
+ - {{ . }}
69
+ {{- end }}
70
+ ```
53
71
54
72
Template directives should have whitespace after the opening braces and before
55
73
the closing braces:
@@ -93,6 +111,32 @@ apiVersion: v1
93
111
94
112
## Whitespace in Generated Templates
95
113
114
+ Generated content should be indented with increments of _two spaces_.
115
+
116
+ Correct:
117
+
118
+ ` ` ` yaml
119
+ apiVersion : batch/v1
120
+ kind : Job
121
+ metadata :
122
+ name : example
123
+ labels :
124
+ first : first
125
+ second : second
126
+ ` ` `
127
+
128
+ Incorrect:
129
+
130
+ ` ` ` yaml
131
+ apiVersion : batch/v1
132
+ kind : Job
133
+ metadata :
134
+ name : example
135
+ labels :
136
+ first : first
137
+ second : second
138
+ ` ` `
139
+
96
140
It is preferable to keep the amount of whitespace in generated templates to a
97
141
minimum. In particular, numerous blank lines should not appear adjacent to each
98
142
other. But occasional empty lines (particularly between logical sections) is
You can’t perform that action at this time.
0 commit comments