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

No formatter for "" on .rubocop file #6880

Closed
huarmenta opened this issue Apr 4, 2019 · 1 comment · Fixed by #7015
Closed

No formatter for "" on .rubocop file #6880

huarmenta opened this issue Apr 4, 2019 · 1 comment · Fixed by #7015
Labels

Comments

@huarmenta
Copy link

huarmenta commented Apr 4, 2019

Expected behavior

rubocop should append -f / --format options when added to a .rubocop file and execute it correctly.

Actual behavior

When -f or --format option is added to a .rubocop file it shows the following error:

No formatter for " progress"
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rubocop-0.66.0/lib/rubocop/formatter/formatter_set.rb:87:in `builtin_formatter_class'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rubocop-0.66.0/lib/rubocop/formatter/formatter_set.rb:78:in `formatter_class'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rubocop-0.66.0/lib/rubocop/formatter/formatter_set.rb:60:in `add_formatter'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rubocop-0.66.0/lib/rubocop/runner.rb:321:in `block in formatter_set'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rubocop-0.66.0/lib/rubocop/runner.rb:320:in `each'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rubocop-0.66.0/lib/rubocop/runner.rb:320:in `formatter_set'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rubocop-0.66.0/lib/rubocop/runner.rb:76:in `ensure in inspect_files'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rubocop-0.66.0/lib/rubocop/runner.rb:77:in `inspect_files'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rubocop-0.66.0/lib/rubocop/runner.rb:39:in `run'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rubocop-0.66.0/lib/rubocop/cli.rb:174:in `execute_runner'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rubocop-0.66.0/lib/rubocop/cli.rb:75:in `execute_runners'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rubocop-0.66.0/lib/rubocop/cli.rb:47:in `run'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rubocop-0.66.0/exe/rubocop:13:in `block in <top (required)>'
/.rbenv/versions/2.6.1/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rubocop-0.66.0/exe/rubocop:12:in `<top (required)>'
/.rbenv/versions/2.6.1/bin/rubocop:23:in `load'
/.rbenv/versions/2.6.1/bin/rubocop:23:in `<top (required)>'
/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `load'
/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `kernel_load'
/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/cli/exec.rb:28:in `run'
/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/cli.rb:463:in `exec'
/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/cli.rb:27:in `dispatch'
/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/cli.rb:18:in `start'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30:in `block in <top (required)>'
/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22:in `<top (required)>'
/.rbenv/versions/2.6.1/bin/bundle:23:in `load'
/.rbenv/versions/2.6.1/bin/bundle:23:in `<main>

Steps to reproduce the problem

  1. $ touch .rubocop
  2. Add --format progress to .rubocop file
  3. $ [bundle exec] rubocop

RuboCop version

$ [bundle exec] rubocop -V
0.66.0 (using Parser 2.6.2.0, running on ruby 2.6.1 x86_64-darwin18)
@Drenmi Drenmi added the bug label Apr 4, 2019
hoshinotsuyoshi added a commit to hoshinotsuyoshi/rubocop that referenced this issue May 3, 2019
…sing

* After this commit, RuboCop parses `.rubocop`(even if content is like `--format progress`) correctly.
* More natural test case of `.rubocop` file content.
@hoshinotsuyoshi
Copy link
Contributor

I thought that RuboCop::Options#parse need to be fixed, so opened #7015 . 😃

@koic koic closed this as completed in #7015 May 3, 2019
koic added a commit that referenced this issue May 3, 2019
[Fix #6880] Fix RuboCop::Options#parse for `.rubocop` file parsing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants