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
Running puppet-lint (version 2.4.2) on the following:
#classntp (
# XXX: remove "self" from the list
Array[String] $ntp_servers = [
'foo',
'bar',
'baz',
] - $::fqdn,
Array[String] $pools = [],
) {
...
}
Gives WARNING: optional parameter listed before required parameter on line 8.
However, puppet itself (6.18) has no problem removing the $::fqdn element from the $ntp_servers array. A workaround is to use the delete() function from puppetlabs-stdlib like this:
#classntp (
# XXX: remove "self" from the list
Array[String] $ntp_servers = delete([
'foo',
'bar',
'baz',
], $::fqdn),
Array[String] $pools = [],
) {
...
}
P.S.: thanks a lot for working on this fantastic tool!
The text was updated successfully, but these errors were encountered:
Class/defined type parameter name tokens can be more accurately selected
based on the type of non-whitespace token that preceeds it.
`:VARIABLE` preceeded by:
* `:LPAREN` - First parameter, no data type
* `:COMMA` - Subsequent parameters, no data type
* `:TYPE` - Parameter with a simple data type (e.g. `String`)
* `:RBRACK - Parameter with a complex data type (e.g. `Array[String]`)
As before, tokens within balanced pairs of parens will be automatically
skipped over, preventing a function call that takes a variable parameter
from generating a false positive in the first 2 cases.
Fixes#930
Class/defined type parameter name tokens can be more accurately selected
based on the type of non-whitespace token that preceeds it.
`:VARIABLE` preceeded by:
* `:LPAREN` - First parameter, no data type
* `:COMMA` - Subsequent parameters, no data type
* `:TYPE` - Parameter with a simple data type (e.g. `String`)
* `:RBRACK - Parameter with a complex data type (e.g. `Array[String]`)
As before, tokens within balanced pairs of parens will be automatically
skipped over, preventing a function call that takes a variable parameter
from generating a false positive in the first 2 cases.
Fixes#930
Running puppet-lint (version 2.4.2) on the following:
Gives
WARNING: optional parameter listed before required parameter on line 8
.However, puppet itself (6.18) has no problem removing the
$::fqdn
element from the$ntp_servers
array. A workaround is to use thedelete()
function from puppetlabs-stdlib like this:P.S.: thanks a lot for working on this fantastic tool!
The text was updated successfully, but these errors were encountered: