Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an error when .rubocop.yml is empty
This PR fixes the following error when .rubocop.yml is empty. ```console % touch .rubocop.yml % rubocop /Users/koic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.34.1/lib/rubocop/server/cache.rb:75:in `block in cache_root_dir_from_config': undefined method `dig' for nil:NilClass (NoMethodError) config_yaml.dig('AllCops', 'CacheRootDirectory') ^^^^ from /Users/koic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.34.1/lib/rubocop/cache_config.rb:9:in `root_dir' from /Users/koic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.34.1/lib/rubocop/server/cache.rb:61:in `cache_root_dir_from_config' from /Users/koic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.34.1/lib/rubocop/server/cache.rb:54:in `cache_path' from /Users/koic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.34.1/lib/rubocop/server/cache.rb:45:in `dir' from /Users/koic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.34.1/lib/rubocop/server.rb:36:in `running?' from /Users/koic/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rubocop-1.34.1/exe/rubocop:11:in `<top (required)>' from /Users/koic/.rbenv/versions/3.1.2/bin/rubocop:25:in `load' from /Users/koic/.rbenv/versions/3.1.2/bin/rubocop:25:in `<main>' ```
- Loading branch information