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
--auto-gen-config
Style/MethodCallWithArgsParentheses blows up when trying to use --auto-gen-config on a project which violates it.
Style/MethodCallWithArgsParentheses
--auto-gen-config should generate the config without blowing up
It blows up with undefined method 'to_sym' for nil:NilClass when trying to generate the config:
undefined method 'to_sym' for nil:NilClass
$ bundle exec rubocop --auto-gen-config Phase 1 of 2: run Layout/LineLength cop Inspecting 2 files .. 2 files inspected, no offenses detected Created .rubocop_todo.yml. Phase 2 of 2: run all cops Inspecting 2 files CC 2 files inspected, 8 offenses detected undefined method `to_sym' for nil:NilClass ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cop/mixin/configurable_enforced_style.rb:65:in `style' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cop/style/method_call_with_args_parentheses.rb:153:in `initialize' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/disabled_config_formatter.rb:124:in `new' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/disabled_config_formatter.rb:124:in `output_cop_comments' ...
~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/disabled_config_formatter.rb:99:in `output_cop' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/disabled_config_formatter.rb:86:in `block in output_offenses' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/disabled_config_formatter.rb:85:in `each' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/disabled_config_formatter.rb:85:in `output_offenses' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/disabled_config_formatter.rb:52:in `finished' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/formatter_set.rb:33:in `block (3 levels) in <class:FormatterSet>' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/formatter_set.rb:33:in `each' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/formatter_set.rb:33:in `block (2 levels) in <class:FormatterSet>' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/runner.rb:81:in `inspect_files' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/runner.rb:39:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/command/execute_runner.rb:21:in `execute_runner' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/command/execute_runner.rb:13:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/command.rb:10:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/environment.rb:17:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/command/auto_genenerate_config.rb:100:in `execute_runner' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/command/auto_genenerate_config.rb:78:in `run_all_cops' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/command/auto_genenerate_config.rb:22:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/command.rb:10:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/environment.rb:17:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli.rb:65:in `run_command' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli.rb:70:in `execute_runners' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli.rb:41:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/exe/rubocop:13:in `block in <top (required)>' /opt/rubies/2.6.3/lib/ruby/2.6.0/benchmark.rb:308:in `realtime' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/exe/rubocop:12:in `<top (required)>' ~/.gem/ruby/2.6.3/bin/rubocop:23:in `load' ~/.gem/ruby/2.6.3/bin/rubocop:23:in `<top (required)>' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `load' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `kernel_load' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:28:in `run' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/cli.rb:463:in `exec' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in `dispatch' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/cli.rb:18:in `start' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/exe/bundle:30:in `block in <top (required)>' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/exe/bundle:22:in `<top (required)>' ~/.gem/ruby/2.6.3/bin/bundle:23:in `load' ~/.gem/ruby/2.6.3/bin/bundle:23:in `<main>'
Create a new directory
Create the following Gemfile
# Gemfile.rb source 'https://rubygems.org' gem 'rubocop'
The calls to source and gem violate the Style/MethodCallWithArgsParentheses rule.
source
gem
# .rubocop.yml Style/MethodCallWithArgsParentheses: Enabled: true
bundle install
bundle exec rubocop --auto-gen-config 💥
bundle exec rubocop --auto-gen-config
$ bundle exec rubocop -V 0.79.0 (using Parser 2.7.0.2, running on ruby 2.6.3 x86_64-darwin19)
The text was updated successfully, but these errors were encountered:
This sounds like it could be related to some changes I did recently on this cop. I can take a look tomorrow.
Sorry, something went wrong.
[Fix rubocop#7688] Support MethodCallWithArgsParentheses.new without …
c7a1440
…config
[Fix #7688] Support MethodCallWithArgsParentheses.new without config
e672f90
Successfully merging a pull request may close this issue.
Style/MethodCallWithArgsParentheses
blows up when trying to use--auto-gen-config
on a project which violates it.Expected behavior
--auto-gen-config
should generate the config without blowing upActual behavior
It blows up with
undefined method 'to_sym' for nil:NilClass
when trying to generate the config:Rest of stack trace
~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/disabled_config_formatter.rb:99:in `output_cop' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/disabled_config_formatter.rb:86:in `block in output_offenses' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/disabled_config_formatter.rb:85:in `each' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/disabled_config_formatter.rb:85:in `output_offenses' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/disabled_config_formatter.rb:52:in `finished' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/formatter_set.rb:33:in `block (3 levels) in <class:FormatterSet>' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/formatter_set.rb:33:in `each' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/formatter/formatter_set.rb:33:in `block (2 levels) in <class:FormatterSet>' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/runner.rb:81:in `inspect_files' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/runner.rb:39:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/command/execute_runner.rb:21:in `execute_runner' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/command/execute_runner.rb:13:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/command.rb:10:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/environment.rb:17:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/command/auto_genenerate_config.rb:100:in `execute_runner' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/command/auto_genenerate_config.rb:78:in `run_all_cops' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/command/auto_genenerate_config.rb:22:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/command.rb:10:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli/environment.rb:17:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli.rb:65:in `run_command' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli.rb:70:in `execute_runners' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/lib/rubocop/cli.rb:41:in `run' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/exe/rubocop:13:in `block in <top (required)>' /opt/rubies/2.6.3/lib/ruby/2.6.0/benchmark.rb:308:in `realtime' ~/.gem/ruby/2.6.3/gems/rubocop-0.79.0/exe/rubocop:12:in `<top (required)>' ~/.gem/ruby/2.6.3/bin/rubocop:23:in `load' ~/.gem/ruby/2.6.3/bin/rubocop:23:in `<top (required)>' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `load' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `kernel_load' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:28:in `run' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/cli.rb:463:in `exec' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in `dispatch' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/cli.rb:18:in `start' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/exe/bundle:30:in `block in <top (required)>' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors' ~/.gem/ruby/2.6.3/gems/bundler-1.17.3/exe/bundle:22:in `<top (required)>' ~/.gem/ruby/2.6.3/bin/bundle:23:in `load' ~/.gem/ruby/2.6.3/bin/bundle:23:in `<main>'
Steps to reproduce the problem
Create a new directory
Create the following Gemfile
The calls to
source
andgem
violate theStyle/MethodCallWithArgsParentheses
rule.bundle install
bundle exec rubocop --auto-gen-config
💥RuboCop version
The text was updated successfully, but these errors were encountered: