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 key?' for nil:NilClass when AllCops` is empty #2772

Closed
volmer opened this issue Feb 3, 2016 · 0 comments
Closed

undefined method key?' for nil:NilClass when AllCops` is empty #2772

volmer opened this issue Feb 3, 2016 · 0 comments

Comments

@volmer
Copy link
Contributor

volmer commented Feb 3, 2016

With the following content on rubocop.yml

AllCops:

RuboCop explodes:

undefined method `key?' for nil:NilClass
/Users/volmer/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/config.rb:241:in `check_obsolete_parameter'
/Users/volmer/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/config.rb:235:in `reject_obsolete_parameters'
/Users/volmer/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/config.rb:114:in `validate'
/Users/volmer/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/config_loader.rb:48:in `load_file'
/Users/volmer/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/config_loader.rb:96:in `configuration_from_file'
/Users/volmer/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/config_store.rb:41:in `for'
/Users/volmer/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/cli.rb:88:in `apply_default_formatter'
/Users/volmer/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/lib/rubocop/cli.rb:26:in `run'
/Users/volmer/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/bin/rubocop:14:in `block in <top (required)>'
/Users/volmer/.rbenv/versions/2.3.0/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
/Users/volmer/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rubocop-0.36.0/bin/rubocop:13:in `<top (required)>'
/Users/volmer/.rbenv/versions/2.3.0/bin/rubocop:23:in `load'
/Users/volmer/.rbenv/versions/2.3.0/bin/rubocop:23:in `<main>'

I think instead it should raise RuboCop::ValidationError complaining about the empty config, or maybe just ignore AllCops altogether.

@bbatsov bbatsov closed this as completed in c7f1c25 Feb 9, 2016
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

No branches or pull requests

1 participant