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
The Puppet 5.x documentation requires that Boolean types are quoted when used in Enum declarations [here|https://docs.puppet.com/puppet/5.0/lang_data_type.html#syntax]
To be clear, the following statement will not compile without the quotes around the boolean values:
puppet-lint should allow quoted Booleans in this specific context.
Note: disabling this for a specific line works when testing puppet code, however the Puppet Forge explicitly ignores disabled checks in a module leading to an 0.0 score for a required breach of style for correct syntax.
The text was updated successfully, but these errors were encountered:
It's not an anti-pattern per se, but it's not required either. The example from the docs accepts booleans OR strings true and false. While I am a fan of using booleans vs strings personally, I don't know that I would foist that opinion on others.
However, the style guide is more important there. I'm not in a position to check it now, but that's the reference we need to check.
I think this is an anti-pattern in the documentation that should be fixed there. Allowing quoted booleans in the Enum in puppet-lint would just shift the problem to another manifest, as wherever the defined type or class that used this data type was instantiated would then throw a quoted boolean error.
class test {
Variant[Boolean, Enum['true', 'false', 'absent', 'present']] $ensure,
}
class { 'test':
ensure => 'true', # <== We've just shifted the puppet-lint warning to here.
}
The Puppet 5.x documentation requires that Boolean types are quoted when used in Enum declarations [here|https://docs.puppet.com/puppet/5.0/lang_data_type.html#syntax]
To be clear, the following statement will not compile without the quotes around the boolean values:
puppet-lint should allow quoted Booleans in this specific context.
Note: disabling this for a specific line works when testing puppet code, however the Puppet Forge explicitly ignores disabled checks in a module leading to an 0.0 score for a required breach of style for correct syntax.
The text was updated successfully, but these errors were encountered: