File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -178,10 +178,15 @@ There are a few things that can be checked if you review a pull request against
178
178
* Does it need additional tests? Add the ` needs-tests ` label
179
179
* Does it have failing tests? Add the ` tests-fail ` label
180
180
* Are new parameters introduced? They must have datatypes
181
- * If you can supply one or multiple values for an attribute it's common practice
182
- to enforce the datatype for one value and an array of that datatype. An
183
- example for string is ` Variant[String[1],Array[String[1]]] ` . This can be used
184
- in the Puppet code as ` [$var].flatten() `
181
+ * If you can supply multiple values for an attribute it's common practice to
182
+ enforce the datatype as an array of values, even if the default is a single
183
+ item. This cuts down on code and remove some edge cases. An example for string
184
+ is ` Array[String[1]] ` instead of ` Variant[String[1],Array[String[1]]] ` .
185
+
186
+ Note that previously the recommendation was to have a ` Variant ` type, but this
187
+ causes problems with values that contain Arrays, e.g. `Variant[ Tuple[ String,
188
+ Array] , Array[ Tuple[ String, Array]]] ` (which would unintentionally flatten the
189
+ array inside the tuple).
185
190
* Are facts used? They should only be accessed via ` $facts[] ` or
186
191
[ fact()] ( https://github.com/puppetlabs/puppetlabs-stdlib#fact ) from stdlib,
187
192
but not topscope variables
You can’t perform that action at this time.
0 commit comments