-
Notifications
You must be signed in to change notification settings - Fork 4
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
plugin converts scoped variables into $facts hash #10
Comments
It comes second alphabetically, so AFAICT, will be registered after this plugin and will be run after too?? |
This plugin at version For example, this:
Throws this error:
And thinking about it... how is this plugin supposed to know what's a fact and what's a real top-scope variable? |
Ah, ignore my last question.. it's right in the docs: https://github.com/mmckinst/puppet-lint-top_scope_facts-check#configuring-the-check The list of top-scope-variables can be configured. |
We've noticed that the current behaviour of this plugin seems to conflict with other plugins.
There's some history in puppetlabs/puppet-lint#41
Most notably this plugin seems to want to convert all variables with $:: to top level facts, even if they're scoped variables, which results in some weird syntax depending on which plugin gets there first.
Example:
It attempts to convert:
$::myodule::foo
Into:
$facts['mymodule']::foo
However In the event that the topscope_variable plugin gets there first, it'll give you a more reasonable:
use $mymodule::foo instead of $::mymodule::foo
The shortest solution i can think of for this, is similar to Alex's solution for voxpupuli/puppet-lint-topscope-variable-check#12 where we exclude anything ending in
::
The text was updated successfully, but these errors were encountered: