Open tuxmea opened 8 months ago
I get the impression that it's a bug in the plugin. If we check the stack trace:
That ends up being nil - 1
. In https://github.com/puppetlabs/puppet-lint/pull/172 I tried to formalize the API, but implicitly it says index
must be an integer.
Looking at the next frame:
That just passes it along, so the same API.
The next frame is the plugin:
So tokens.index(token)
ends up being nil
. Note it is in the fix(problem)
method and you have multiple problems there, so I think 2 plugins both fix the token stream. What probably happens is that one rewrites it to
file {$test:
ensure => file,
}
And then the whitespace check wants to rewrite it to:
file { "${test}":
ensure => file,
}
But the "
token no longer exists, so it is nil
.
Describe the Bug
In some cases lint is unable to autofix the string containing only a variable lint check.
Expected Behavior
Lint will autofix
Steps to Reproduce
See code below
Environment
Additional Context
puppet-lint version: 4.0.0 ruby version: 3.2.2-p53 platform: x86_64-darwin21 file path: manifests/init.pp file contents:
error: