Skip to content

Commit

Permalink
Fix undefined method `status' for #<RuboCop::ConfigNotFoundError> (No…
Browse files Browse the repository at this point in the history
…MethodError)

```
$ rubocop -c file_that_does_not_exist.yml foo.rb
Configuration file not found: /Users/onaka/src/github.com/bbatsov/rubocop/file_that_does_not_exist.yml
Traceback (most recent call last):
        6: from /Users/onaka/.gem/ruby/2.6.0/bin/rubocop:23:in `<main>'
        5: from /Users/onaka/.gem/ruby/2.6.0/bin/rubocop:23:in `load'
        4: from /Users/onaka/.gem/ruby/2.6.0/gems/rubocop-0.53.0/bin/rubocop:12:in `<top (required)>'
        3: from /opt/rubies/2.6.0-dev/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
        2: from /Users/onaka/.gem/ruby/2.6.0/gems/rubocop-0.53.0/bin/rubocop:13:in `block in <top (required)>'
        1: from /Users/onaka/.gem/ruby/2.6.0/gems/rubocop-0.53.0/lib/rubocop/cli.rb:36:in `run'
/Users/onaka/.gem/ruby/2.6.0/gems/rubocop-0.53.0/lib/rubocop/cli.rb:44:in `rescue in run': undefined method `status' for #<RuboCop::ConfigNotFoundError:0x00007fd0b808e040> (NoMethodError)
```
  • Loading branch information
onk authored and bbatsov committed Mar 9, 2018
1 parent 55a2fb4 commit 88fac0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* [#5623](https://github.com/bbatsov/rubocop/pull/5623): Fix `Bundler/OrderedGems` when a group includes duplicate gems. ([@colorbox][])
* [#5633](https://github.com/bbatsov/rubocop/pull/5633): Fix broken `--fail-fast`. ([@mmyoji][])
* [#5630](https://github.com/bbatsov/rubocop/issues/5630): Fix false positive for `Style/FormatStringToken` when using placeholder arguments in `format` method. ([@koic][])
* [#5651](https://github.com/bbatsov/rubocop/pull/5651): Fix NoMethodError when specified config file that does not exist. ([@onk][])

### Changes

Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def run(args = ARGV)
execute_runners(paths)
rescue RuboCop::ConfigNotFoundError => e
warn e.message
e.status
STATUS_ERROR
rescue RuboCop::Error => e
warn Rainbow("Error: #{e.message}").red
STATUS_ERROR
Expand Down

0 comments on commit 88fac0e

Please sign in to comment.