Closed alexjfisher closed 4 years ago
git bisect reveals https://github.com/rodjek/puppet-lint/pull/846/commits/8da7c7c232b4a25f5158a61b3bb7d29eebbcbeea (from https://github.com/rodjek/puppet-lint/pull/846) to be the commit that broke this.
If I'm not mistaken the new way to tokenise is wanted.
A dedicated test for tokenising ${foo[bar][baz]}
inside an interpolated string was changed
from expecting one token <Token :VARIABLE (foo[bar][baz]) ...>
to [expecting multiple tokens <Token :VARIABLE (foo) ...> <Token :LBRACK ([) ...> <Token :NAME (bar) ...>
and so forth](https://github.com/rodjek/puppet-lint/blob/8f66ab66ed/spec/puppet-lint/lexer_spec.rb#L334-L405).
That happened in 8da7c7c (the commit you found with git bisect).
@rodjek will probably comment on this, but to me it looks like the plugin puppet-lint-legacy_facts-check needs to be changed.
Yeah, the old pre 2.4.x method of tokenising double quoted strings was broken and not consistent with how they were tokenised outside of string interpolation. It is a significant change though so I'll submit a PR to that plugin to fix it up
What needs to be changed in puppet-lint-legacy_facts-check to fix this?
@rodjek di you have an advise for @mmckinst ?
Sorry about the delay, I've opened mmckinst/puppet-lint-legacy_facts-check#32 to address this
PR merged into puppet-lint-legacy_facts-check and released
With 2.3.6
(from https://github.com/voxpupuli/puppet-proxysql/blob/c5fc8dfbce1d78b93613278d3da5742f318dd281/manifests/params.pp#L40) fails the
legacy facts
check, but since 2.4.0 is no longer detected.Looks like that line is being tokenised differently now??
<Token :VARIABLE (facts['lsbdistcodename']) @40:72>
vs<Token :VARIABLE (facts) @40:73>