r7kamura / rubocop-slim

RuboCop plugin for Slim template.
MIT License
6 stars 1 forks source link

Gem not available #2

Closed Nerian closed 1 year ago

Nerian commented 1 year ago

Hi,

I believe the gem has not ben pushed to rubygems.

rubocop-slim

Is this expected? Is it not ready to be used?

Regards, Gonzalo.

Nerian commented 1 year ago

I tried using it directly via github.

gem 'rubocop-slim', github: 'r7kamura/rubocop-slim'

But I get the following error:

$ rubocop

undefined method `ruby_extractors' for RuboCop::Runner:Class

RuboCop::Runner.ruby_extractors.unshift(RuboCop::Slim::RubyExtractor)
               ^^^^^^^^^^^^^^^^
/Users/Nerian/.rvm/gems/ruby-3.1.2/bundler/gems/rubocop-slim-9dd2c1e0d0be/lib/rubocop/slim/rubocop_extension.rb:5:in `<top (required)>'
/Users/Nerian/.rvm/gems/ruby-3.1.2/bundler/gems/rubocop-slim-9dd2c1e0d0be/lib/rubocop/slim.rb:12:in `require_relative'
/Users/Nerian/.rvm/gems/ruby-3.1.2/bundler/gems/rubocop-slim-9dd2c1e0d0be/lib/rubocop/slim.rb:12:in `<top (required)>'
/Users/Nerian/.rvm/gems/ruby-3.1.2/bundler/gems/rubocop-slim-9dd2c1e0d0be/lib/rubocop-slim.rb:3:in `require'
/Users/Nerian/.rvm/gems/ruby-3.1.2/bundler/gems/rubocop-slim-9dd2c1e0d0be/lib/rubocop-slim.rb:3:in `<top (required)>'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/feature_loader.rb:35:in `require'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/feature_loader.rb:35:in `load'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/feature_loader.rb:21:in `load'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:14:in `block (2 levels) in resolve_requires'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:13:in `each'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:13:in `block in resolve_requires'
<internal:kernel>:90:in `tap'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:12:in `resolve_requires'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/config_loader.rb:46:in `load_file'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:210:in `block in base_configs'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:209:in `map'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:209:in `base_configs'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:21:in `resolve_inheritance'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/config_loader.rb:53:in `load_file'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/config_loader.rb:104:in `configuration_from_file'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/config_store.rb:68:in `for_dir'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/config_store.rb:47:in `for_pwd'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/cli.rb:99:in `parallel_by_default!'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/lib/rubocop/cli.rb:46:in `run'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/exe/rubocop:19:in `block in <top (required)>'
/Users/Nerian/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/benchmark.rb:311:in `realtime'
/Users/Nerian/.rvm/gems/ruby-3.1.2/gems/rubocop-1.39.0/exe/rubocop:19:in `<top (required)>'
/Users/Nerian/.rvm/gems/ruby-3.1.2/bin/rubocop:25:in `load'
/Users/Nerian/.rvm/gems/ruby-3.1.2/bin/rubocop:25:in `<top (required)>'
/Users/Nerian/.rvm/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/bundler/cli/exec.rb:58:in `load'
/Users/Nerian/.rvm/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/bundler/cli/exec.rb:58:in `kernel_load'
/Users/Nerian/.rvm/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/bundler/cli/exec.rb:23:in `run'
/Users/Nerian/.rvm/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/bundler/cli.rb:486:in `exec'
/Users/Nerian/.rvm/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/Nerian/.rvm/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/Users/Nerian/.rvm/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/Users/Nerian/.rvm/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/bundler/cli.rb:31:in `dispatch'
/Users/Nerian/.rvm/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/Users/Nerian/.rvm/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/bundler/cli.rb:25:in `start'
/Users/Nerian/.rvm/rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/exe/bundle:48:in `block in <top (required)>'
/Users/Nerian/.rvm/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/bundler/friendly_errors.rb:120:in `with_friendly_errors'
/Users/Nerian/.rvm/rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/exe/bundle:36:in `<top (required)>'
/Users/Nerian/.rvm/gems/ruby-3.1.2/bin/bundle:25:in `load'
/Users/Nerian/.rvm/gems/ruby-3.1.2/bin/bundle:25:in `<main>'
r7kamura commented 1 year ago

Thanks for your interest and try in this gem.

Actually, this gem is not yet available because the API to support templates in RuboCop is still under discussion in the following Pull Request and has not been merged yet.

If you want to try to use it, please use the forked version of rubocop gem like this:

# Gemfile
gem 'rubocop', github: 'r7kamura/rubocop', branch: 'feature/template-support'
gem 'rubocop-slim', github: 'r7kamura/rubocop-slim', branch: 'main'

I'll also note in the README that it's still under construction to avoid confusion🙏

Nerian commented 1 year ago

Ah I see. Alrighty then. Will keep an eye on that PR, thanks 👍

r7kamura commented 1 year ago

Released 🎉