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 @@ -210,10 +210,15 @@ There are a few things that can be checked if you review a pull request against
210
210
[ POSIX
211
211
standard] ( http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 ) ,
212
212
and some tools don't handle the lack of a terminating newline properly
213
- * If you can supply one or multiple values for an attribute it's common practice
214
- to enforce the datatype for one value and an array of that datatype. An
215
- example for string is ` Variant[String[1],Array[String[1]]] ` . This can be used
216
- in the Puppet code as ` [$var].flatten() `
213
+ * If you can supply multiple values for an attribute it's common practice to
214
+ enforce the datatype as an array of values, even if the default is a single
215
+ item. This cuts down on code and remove some edge cases. An example for string
216
+ is ` Array[String[1]] ` instead of ` Variant[String[1],Array[String[1]]] ` .
217
+
218
+ Note that previously the recommendation was to have a ` Variant ` type, but this
219
+ causes problems with values that contain Arrays, e.g. `Variant[ Tuple[ String,
220
+ Array] , Array[ Tuple[ String, Array]]] ` (which would unintentionally flatten the
221
+ array inside the tuple).
217
222
* The parameter section should always be aligned at the ` = ` char
218
223
* Is a class considered private? Then it should contain
219
224
[ assert_private] ( https://github.com/puppetlabs/puppetlabs-stdlib#assert_private )
You can’t perform that action at this time.
0 commit comments