rodjek / puppet-lint

Check that your Puppet manifests conform to the style guide
MIT License
820 stars 204 forks source link

puppet-lint error #917

Closed hfrog closed 4 years ago

hfrog commented 4 years ago

Hello, Today I've discovered and puppet-lint error:

Whoops! It looks like puppet-lint has encountered an error that it doesn't know how to handle. Please open an issue at https://github.com/rodjek/puppet-lint and paste the following output into the issue description.

puppet-lint version: 2.3.3 ruby version: 2.5.1-p57 platform: x86_64-linux-gnu file path: test.pp file contents:

class test (
  Array[String[1]] $urls,
) {

  run::cmd {'test':
    cmd => @("CMD"/L),
      /usr/local/bin/test \
      ${join($urls.map |$v| { "-b $v" }, ' ')}
      | - CMD
  }

}

error:

NoMethodError: undefined method `next_token' for nil:NilClass
/usr/lib/ruby/vendor_ruby/puppet-lint/lexer/token.rb:196:in `find_token_of'
/usr/lib/ruby/vendor_ruby/puppet-lint/lexer/token.rb:142:in `next_token_of'
/usr/lib/ruby/vendor_ruby/puppet-lint/data.rb:176:in `block in resource_indexes'
/usr/lib/ruby/vendor_ruby/puppet-lint/data.rb:171:in `each'
/usr/lib/ruby/vendor_ruby/puppet-lint/data.rb:171:in `resource_indexes'
/usr/lib/ruby/vendor_ruby/puppet-lint/checkplugin.rb:81:in `resource_indexes'
/usr/lib/ruby/vendor_ruby/puppet-lint/plugins/check_whitespace/arrow_alignment.rb:9:in `check'
/usr/lib/ruby/vendor_ruby/puppet-lint/checkplugin.rb:21:in `run'
/usr/lib/ruby/vendor_ruby/puppet-lint/checks.rb:60:in `block in run'
/usr/lib/ruby/vendor_ruby/puppet-lint/checks.rb:57:in `each'
/usr/lib/ruby/vendor_ruby/puppet-lint/checks.rb:57:in `run'
/usr/lib/ruby/vendor_ruby/puppet-lint.rb:196:in `run'
/usr/lib/ruby/vendor_ruby/puppet-lint/bin.rb:59:in `block in run'
/usr/lib/ruby/vendor_ruby/puppet-lint/bin.rb:56:in `each'
/usr/lib/ruby/vendor_ruby/puppet-lint/bin.rb:56:in `run'
/usr/bin/puppet-lint:7:in `<main>'

Thank you, Andrew.

rodjek commented 4 years ago

2.3.3 is a pretty old version of puppet-lint (released in late 2017), I'd recommend updating to the latest version (2.4.2) and seeing if the error persists

hfrog commented 4 years ago

Thank you, Let's close the issue then