Skip to content
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

"undefined method `next_token='" when fixing with check_whitespace #680

Closed
domcleal opened this issue Mar 29, 2017 · 1 comment · Fixed by #684
Closed

"undefined method `next_token='" when fixing with check_whitespace #680

domcleal opened this issue Mar 29, 2017 · 1 comment · Fixed by #684

Comments

@domcleal
Copy link
Contributor

When running puppet-lint -f examples/file_line.pp, it fails with an exception:

puppet-lint version: 2.2.0
ruby version: 2.3.0-p0
platform: x86_64-linux
file path: examples/file_line.pp
file contents:

# This is a simple smoke test
# of the file_line resource type.
file { '/tmp/dansfile':
  ensure => file,
} ->
file_line { 'dans_line':
  line => 'dan is awesome',
  path => '/tmp/dansfile',
}

error:

NoMethodError: undefined method `next_token=' for nil:NilClass
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/gems/puppet-lint-2.2.0/lib/puppet-lint/plugins/check_whitespace.rb:49:in `fix'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/gems/puppet-lint-2.2.0/lib/puppet-lint/checkplugin.rb:41:in `block in fix_problems'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/gems/puppet-lint-2.2.0/lib/puppet-lint/checkplugin.rb:38:in `each'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/gems/puppet-lint-2.2.0/lib/puppet-lint/checkplugin.rb:38:in `fix_problems'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/gems/puppet-lint-2.2.0/lib/puppet-lint/checks.rb:61:in `block in run'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/gems/puppet-lint-2.2.0/lib/puppet-lint/checks.rb:56:in `each'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/gems/puppet-lint-2.2.0/lib/puppet-lint/checks.rb:56:in `run'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/gems/puppet-lint-2.2.0/lib/puppet-lint.rb:191:in `run'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/gems/puppet-lint-2.2.0/lib/puppet-lint/bin.rb:59:in `block in run'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/gems/puppet-lint-2.2.0/lib/puppet-lint/bin.rb:56:in `each'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/gems/puppet-lint-2.2.0/lib/puppet-lint/bin.rb:56:in `run'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/gems/puppet-lint-2.2.0/bin/puppet-lint:7:in `<top (required)>'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/bin/puppet-lint:22:in `load'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/bin/puppet-lint:22:in `<main>'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/bin/ruby_executable_hooks:15:in `eval'
/home/dcleal/.rvm/gems/ruby-2.3.0@installer/bin/ruby_executable_hooks:15:in `<main>'
@rodjek
Copy link
Owner

rodjek commented Mar 29, 2017

Looks like this is a result of #672, where the fix method for that check changes the tokens array but doesn't update the links between tokens. I'll get this fixed up shortly and push out a 2.2.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants