-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Rubocop errors with "private method `select' called for nil:NilClass" #1867
Comments
This was caused by overriding AllCops:
Exclude: Fixed by deleting the |
I've got this error in CI. My AllCops:
NewCops: enable
Exclude:
<% `git status --ignored --porcelain`.lines.grep(/^!! /).each do |path| %>
- <%= path.sub(/^!! /, '') %>
<% end %> So, it's not "empty", but I guess the command can return zero entries. Locally it works:
But it's a dynamic list, and in CI there are no such files (they're not required for RuboCop), and I guess I have to wrap |
…ubocop.yml Fixes rubocop#1867. This PR fixes the following error when `AllCops:Exclude` is empty in .rubocop.yml. ```console $ cat .rubocop.yml AllCops: Exclude: $ rubocop (snip) private method `select' called for nil /Users/koic/.rbenv/versions/3.3.0-dev/lib/ruby/gems/3.3.0+0/gems/rubocop-1.54.1/lib/rubocop/target_finder.rb:118: in `combined_exclude_glob_patterns' /Users/koic/.rbenv/versions/3.3.0-dev/lib/ruby/gems/3.3.0+0/gems/rubocop-1.54.1/lib/rubocop/target_finder.rb:85: in `find_files' /Users/koic/.rbenv/versions/3.3.0-dev/lib/ruby/gems/3.3.0+0/gems/rubocop-1.54.1/lib/rubocop/target_finder.rb:59: in `target_files_in_dir' ```
…_is_empty [Fix #1867] Fix an error when `AllCops:Exclude` is empty in .rubocop.yml
I'm getting some error messages on Ruby 2.1.6.
The text was updated successfully, but these errors were encountered: