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

Error with rubocop 0.85 #174

Closed
tomhughes opened this issue Jun 3, 2020 · 6 comments
Closed

Error with rubocop 0.85 #174

tomhughes opened this issue Jun 3, 2020 · 6 comments

Comments

@tomhughes
Copy link

Running erblint with rubocop 0.85 fails:

Exception occured when processing: app/views/issues/show.html.erb
If this file cannot be processed by erb-lint, you can exclude it in your configuration file.
undefined method `reject' for #<RuboCop::Cop::Registry:0x000055f48b351dc8>
/usr/local/share/gems/ruby/2.7.0/gems/rubocop-0.85.0/lib/rubocop/cop/team.rb:147:in `roundup_relevant_cops'
/usr/local/share/gems/ruby/2.7.0/gems/rubocop-0.85.0/lib/rubocop/cop/team.rb:116:in `offenses'
/usr/local/share/gems/ruby/2.7.0/gems/rubocop-0.85.0/lib/rubocop/cop/team.rb:67:in `inspect_file'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/lib/erb_lint/linters/rubocop.rb:71:in `inspect_content'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/lib/erb_lint/linters/rubocop.rb:34:in `block in run'
/usr/local/share/gems/ruby/2.7.0/gems/better_html-1.0.15/lib/better_html/ast/iterator.rb:26:in `<<'
/usr/local/share/gems/ruby/2.7.0/gems/better_html-1.0.15/lib/better_html/ast/iterator.rb:26:in `block (2 levels) in descendants'
/usr/local/share/gems/ruby/2.7.0/gems/better_html-1.0.15/lib/better_html/ast/iterator.rb:14:in `traverse'
/usr/local/share/gems/ruby/2.7.0/gems/better_html-1.0.15/lib/better_html/ast/iterator.rb:20:in `block in traverse_all'
/usr/local/share/gems/ruby/2.7.0/gems/better_html-1.0.15/lib/better_html/ast/iterator.rb:19:in `each'
/usr/local/share/gems/ruby/2.7.0/gems/better_html-1.0.15/lib/better_html/ast/iterator.rb:19:in `traverse_all'
/usr/local/share/gems/ruby/2.7.0/gems/better_html-1.0.15/lib/better_html/ast/iterator.rb:15:in `traverse'
/usr/local/share/gems/ruby/2.7.0/gems/better_html-1.0.15/lib/better_html/ast/iterator.rb:20:in `block in traverse_all'
/usr/local/share/gems/ruby/2.7.0/gems/better_html-1.0.15/lib/better_html/ast/iterator.rb:19:in `each'
/usr/local/share/gems/ruby/2.7.0/gems/better_html-1.0.15/lib/better_html/ast/iterator.rb:19:in `traverse_all'
/usr/local/share/gems/ruby/2.7.0/gems/better_html-1.0.15/lib/better_html/ast/iterator.rb:15:in `traverse'
/usr/local/share/gems/ruby/2.7.0/gems/better_html-1.0.15/lib/better_html/ast/iterator.rb:27:in `block in descendants'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/lib/erb_lint/linters/rubocop.rb:33:in `each'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/lib/erb_lint/linters/rubocop.rb:33:in `each'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/lib/erb_lint/linters/rubocop.rb:33:in `run'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/lib/erb_lint/runner.rb:25:in `block in run'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/lib/erb_lint/runner.rb:24:in `each'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/lib/erb_lint/runner.rb:24:in `run'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/lib/erb_lint/cli.rb:113:in `block in run_with_corrections'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/lib/erb_lint/cli.rb:111:in `times'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/lib/erb_lint/cli.rb:111:in `run_with_corrections'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/lib/erb_lint/cli.rb:63:in `block in run'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/lib/erb_lint/cli.rb:60:in `each'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/lib/erb_lint/cli.rb:60:in `run'
/usr/local/share/gems/ruby/2.7.0/gems/erb_lint-0.0.33/exe/erblint:9:in `<top (required)>'
/usr/local/share/gems/ruby/2.7.0/bin/erblint:23:in `load'
/usr/local/share/gems/ruby/2.7.0/bin/erblint:23:in `<top (required)>'
/usr/local/share/gems/gems/bundler-1.17.2/lib/bundler/cli/exec.rb:74:in `load'
/usr/local/share/gems/gems/bundler-1.17.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/share/gems/gems/bundler-1.17.2/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/share/gems/gems/bundler-1.17.2/lib/bundler/cli.rb:463:in `exec'
/usr/local/share/gems/gems/bundler-1.17.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/share/gems/gems/bundler-1.17.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/share/gems/gems/bundler-1.17.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/share/gems/gems/bundler-1.17.2/lib/bundler/cli.rb:27:in `dispatch'
/usr/local/share/gems/gems/bundler-1.17.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/share/gems/gems/bundler-1.17.2/lib/bundler/cli.rb:18:in `start'
/usr/local/share/gems/gems/bundler-1.17.2/exe/bundle:30:in `block in <top (required)>'
/usr/local/share/gems/gems/bundler-1.17.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/usr/local/share/gems/gems/bundler-1.17.2/exe/bundle:22:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
@tomhughes
Copy link
Author

It looks like the team is expecting to be given an array of cops instead of a RuboCop::Cop::Registry object?

@tomhughes
Copy link
Author

Probably related to rubocop/rubocop#8077 so there is a fix upstream but also fixable by calling mobilize instead of new...

Indeed I can confirm that changing build_team to call RuboCop::Cop::Team.mobilize does fix it.

@ajkerr
Copy link

ajkerr commented Jun 8, 2020

Looks like this was fixed upstream in rubocop 0.85.1.

vaidehijoshi added a commit to forem/forem that referenced this issue Jun 8, 2020
Fixes an erb-lint issue (`undefined method reject for #<RuboCop::Cop::Registry:0x000055f48b351dc8>`).
See Shopify/erb_lint#174 for more.
vaidehijoshi added a commit to forem/forem that referenced this issue Jun 8, 2020
Fixes an erb-lint issue (`undefined method reject for #<RuboCop::Cop::Registry:0x000055f48b351dc8>`).
See Shopify/erb_lint#174 for more.
citizen428 pushed a commit to forem/forem that referenced this issue Jun 15, 2020
Fixes an erb-lint issue (`undefined method reject for #<RuboCop::Cop::Registry:0x000055f48b351dc8>`).
See Shopify/erb_lint#174 for more.
@alex-benoit
Copy link

This shows up again on rubocop 0.87.1 no?

@tomhughes
Copy link
Author

There's a separate issue at #179 for rubocop 0.87 problems.

@sivsubra-tw
Copy link

I am getting this error again with erb-lint 0.4.0 (latest) and rubocop 1.55.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants