This message was deleted.
# voxpupuli
s
This message was deleted.
if you think this is the correct behaviour, how come?
b
there are two linter plugins
one for topscope and one for legacy facts, I think
and voxpupli-puppet-lint-plugins pulls in both
or we vendored them into puppet-lint
b
b
yeah. with both combined you should be fine
b
no, neither will find
$osfamily
either case--you agree that unscoped facts should be flagged, yeah?
yes
👍 1
b
especially in context of puppe8
b
can you raise sn issue and highlight me?
b
the first spec test I linked checks explicitly that it does not catch
$osfamily
😕
a
I was fairly certain some lint plugin already picked this up...
y
but how to distinguish top-level facts and ENC global vars?..
a
You can’t. I wish there had been a $enc introduced at the same time as $facts.
👍🏻 1
There are also node scoped variables which trigger the variable_scope check.
But 99% of the time it’s correct and the rest of the time you can use a control comment. (Which is a useful comment to readers anyway, to explain where a variable comes from)
b
I'm quite sure the legacy_facts check should detect and correct this to
$facts['os']['family']
and when it doesn't do it it's a bug
a
It could, but the existing checks will at least already flag it. The bug report says it’s undetected. Be careful autocorrecting. If you’ve got legacy facts turned off, you wouldn’t want a lint check to touch a locally scoped variable that happens to share the name with an old unused fact ‘corrected’.
b
yeah
I think we need a few more tests for the legacy_fact plugin
*and the topscope_facts
y
It’d be nice to at least to be able to “define” some global vars in a specific comments to allow lint plugins to skip them (instead of making comments on every usage)..
I mean variable scope lint plugin specifically ^
a
Node scope usage isn’t that common though.
And if they’re enc, you should be prefixing with
::
y
though if we can convince Puppet guys to introduce the
$enc
we can do nothing and wait for next major release 🙂
a
Almost always it’s triggered because of a typo. :)