You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class test (
String $s = '',
Custom::Type $t,
) {
}
class test (
String $s = '',
Optional[Boolean] $t,
) {
}
Currently puppet-lint does not recognize it as bad, because
It considers parameters of type Optional[something] optional - this never was the definition of optional parameters in the Puppet docs. If you read docs thoroughly, you'll find out that optional parameters are no more than parameters with default values, whereas Optional type just allows using undef as variable value (and does not make it default value for parameter automatically!).
It does not parse custom types as variable types, and effectively it just ignores such params.
One more thing - anchor in doc URL changed a bit (from #display-order-of-parameters to #params-display-order).
I've prepared a fix for this misbehavior.
The text was updated successfully, but these errors were encountered:
Describe the Bug
Consider the following manifests:
Currently puppet-lint does not recognize it as bad, because
Optional[something]
optional - this never was the definition of optional parameters in the Puppet docs. If you read docs thoroughly, you'll find out that optional parameters are no more than parameters with default values, whereasOptional
type just allows usingundef
as variable value (and does not make it default value for parameter automatically!).One more thing - anchor in doc URL changed a bit (from
#display-order-of-parameters
to#params-display-order
).I've prepared a fix for this misbehavior.
The text was updated successfully, but these errors were encountered: