Commit bb76142
committed
Incorporate review feedback on parameter defaults
From the sig-documentation discussion on inline vs Hiera defaults:
- Note the readability argument for inline defaults: when defaults live
only in Hiera, a reader of init.pp can't tell whether a parameter has a
default elsewhere or must be supplied.
- Add the required-parameter case to the Optional guidance: when a value
is genuinely required with no sensible default, give the parameter no
default at all so compilation fails clearly, rather than papering over
the requirement with Optional[T] = undef.
Signed-off-by: Michael Harp <mike@mikeharp.com>1 parent 9ec4062 commit bb76142
2 files changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
| 212 | + | |
211 | 213 | | |
212 | 214 | | |
213 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
897 | | - | |
| 897 | + | |
898 | 898 | | |
899 | 899 | | |
900 | 900 | | |
| |||
981 | 981 | | |
982 | 982 | | |
983 | 983 | | |
| 984 | + | |
| 985 | + | |
984 | 986 | | |
985 | 987 | | |
986 | 988 | | |
| |||
0 commit comments