We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This cop specifically seems to consistently throw an exception while autocorrecting.
It works fine without --auto-correct
➜ rubocop --only Style/Next 11 Style/Next -- 11 Total
But with, it throws exception.
➜ rubocop --only Style/Next --auto-correct -- 0 Total undefined method `end_pos' for nil:NilClass /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/cop/style/next.rb:135:in `end_range' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/cop/style/next.rb:118:in `block in autocorrect' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/cop/corrector.rb:47:in `block in rewrite' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/cop/corrector.rb:46:in `each' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/cop/corrector.rb:46:in `rewrite' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/cop/team.rb:91:in `autocorrect_one_cop' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/cop/team.rb:68:in `autocorrect' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/cop/team.rb:39:in `inspect_file' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/runner.rb:194:in `inspect_file' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rub ➜ ocop-0.36.0/lib/rubocop/runner.rb:164:in `block in do_inspection_loop' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/runner.rb:158:in `loop' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/runner.rb:158:in `do_inspection_loop' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/runner.rb:87:in `process_file' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/runner.rb:59:in `block in inspect_files' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/runner.rb:57:in `each' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/runner.rb:57:in `inspect_files' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/runner.rb:35:in `run' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/cli.rb:30:in `run' /home/toby/.rvm/gems/ruby-2.3.0@global/gems/rubocop-0.36.0/bin/rubocop:14:in `block in <top (required)>' /home/toby/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/benchmark.rb:308:in `realtime' /home/toby/.rvm/gems/ruby-2.3.0@global/gems/rubocop-0.36.0/bin/rubocop:13:in `<top (required)>' /home/toby/.rvm/gems/ruby-2.3.0@cerebro/bin/rubocop:23:in `load' /home/toby/.rvm/gems/ruby-2.3.0@cerebro/bin/rubocop:23:in `<main>' /home/toby/.rvm/gems/ruby-2.3.0@cerebro/bin/ruby_executable_hooks:15:in `eval' /home/toby/.rvm/gems/ruby-2.3.0@cerebro/bin/ruby_executable_hooks:15:in `<main>'
This seems to happen every time for me, but just to be sure it can be reliably produced when running Rubocop on the following test code
module RubocopNextExample def do_things(things) things.each do |thing| fail "Lorem Ipsum" unless thing.include?('foo') end end end
➜ rubocop -V 0.36.0 (using Parser 2.3.0.1, running on ruby 2.3.0 x86_64-linux) ➜ ruby -v ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
The text was updated successfully, but these errors were encountered:
83ce641
Merge pull request #2667 from lumeet/2661_fix_next_autocorrect
45441ee
[Fix #2661] Fix auto-correcting modifiers in Next
No branches or pull requests
This cop specifically seems to consistently throw an exception while autocorrecting.
It works fine without --auto-correct
But with, it throws exception.
This seems to happen every time for me, but just to be sure it can be reliably produced when running Rubocop on the following test code
System
The text was updated successfully, but these errors were encountered: