Skip to content
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

Excessive number of warnings from code_on_top_scope #579

Closed
paran1 opened this issue Dec 12, 2016 · 5 comments
Closed

Excessive number of warnings from code_on_top_scope #579

paran1 opened this issue Dec 12, 2016 · 5 comments

Comments

@paran1
Copy link
Contributor

paran1 commented Dec 12, 2016

code_on_top_scope.pp:
$foo = 'bar'

Expected number of warnings: 1
Actual number of warnings: 3

$ puppet-lint --with-context code_on_top_scope.pp 
WARNING: code outside of class or define block - foo on line 1

  $foo = 'bar'
  ^

WARNING: code outside of class or define block - = on line 1

  $foo = 'bar'
       ^

WARNING: code outside of class or define block - bar on line 1

  $foo = 'bar'
         ^

$ 

Of course the amount of warnings explode further for example if you assign a global variable using a selector.

@rnelson0
Copy link
Collaborator

@paran1 Nice! Can you confirm what version you are on, and if you are pulling from rubygems or a git reference/HEAD?

@paran1
Copy link
Contributor Author

paran1 commented Dec 12, 2016

Oh, sorry! I am at current master (041b430), but the behaviour is the same on 3.0.0. Previous versions didn't include this check.

@paran1
Copy link
Contributor Author

paran1 commented Dec 13, 2016

I just realized that 3.0.0 is a branch rather than a tagged version, so please ignore that. This check is not in any released version.

@rnelson0
Copy link
Collaborator

This does seem excessive. I opened #590 to disable this by default 1) because it's a change to the default plugins that does not match a style guide reference and 2) it probably needs updated to generate one warning per line, not token.

@rnelson0 rnelson0 modified the milestone: 2.1.0 Dec 17, 2016
@rnelson0
Copy link
Collaborator

Closed via #590

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants