-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add noop to variables_in_scope list #92
Comments
That looks wrong, shouldn't it be:
|
Well, no. That would imply that you'd have to pass noop on all calls to da, which would be unusual. You could set ($noop = false), but then you get this: steve@varinia:~$ puppet apply t.pp It seems to me that the puppet upstream considers noop a metaparam and special, and it's puppet-lint that is at fault for not recognizing that. It already has a list of special variables, after all - I'm just asking for one more to be added. Cheers, |
Sorry, I've misread the original code, in this case you don't need to pass metaparameters noop => $noop, for example if you add require metaparameter the attribute should be added to all resources in the define.
So I'm not sure noop should be added. |
OK, I'll accept that as we're transitioning away from dynamically scoped variables, this one may be messy. I get warnings from puppet about dynamic scoping if I don't make it explicit, and warning from puppet-lint if I do. I'll live with it for now and revisit it once we're no longer using dynamic scoping. Cheers, |
(MAINT) Fix typo in check docstring
Hi,
We have a bunch of custom types that trigger lint warnings when we do:
sgran@gnm40439:~$ cat t.pp
define da () {
file { $title: noop => $noop }
}
da { '/tmp/test2': noop => true }
sgran@gnm40439:~$ puppet apply ~/t.pp
notice: Finished catalog run in 0.13 seconds
sgran@gnm40439:~$ puppet-lint ~/t.pp
WARNING: top-scope variable being used without an explicit namespace on line 2
Patch below:
--- a/puppet-lint/lib/puppet-lint/plugins/check_classes.rb 2012-03-28 13:35:14.000000000 +0100
+++ b/puppet-lint/lib/puppet-lint/plugins/check_classes.rb 2012-03-28 13:34:58.000000000 +0100
@@ -91,7 +91,7 @@
check 'variable_scope' do
(class_indexes + defined_type_indexes).each do |idx|
object_tokens = tokens[idx[:start]..idx[:end]]
header_end_idx = object_tokens.index { |r| r.first == :LBRACE }
lparen_idx = object_tokens[0..header_end_idx].index { |r| r.first == :LPAREN }
Cheers,
The text was updated successfully, but these errors were encountered: