Closed reconbot closed 9 years ago
So you have a couple choices off the cuff:
"rbenv"
, "system"
, "rvm+bundler"
)Since 1, so far, seems like a common denominator it's a good idea to maybe start. Like you said, this is a combinatoric problem of the ruby eco.
Correct me if I'm wrong, but might not #14 help with this? Inheriting from RubyLinter
should take care of hooking the linter up with rbenv
or rvm
(using rvm-auto-ruby
).
Support for bundler
should probably be added to RubyLinter
in any case, since it should be common to all Ruby linters.
It would =)
Thanks to @jawshooah our latest version supports rvm and chruby. Bundler is next.
I'm going to close this for now as we haven't had anyone complain about bundlr in a while.
we haven't had anyone complain about bundlr in a while.
Well, I ended-up doing the following change to get it working:
-command = ['ruby', '-S', 'rubocop', '--format', 'emacs']
+command = ['bundle', 'exec', 'ruby', '-S', 'rubocop', '--format', 'emacs']
@oliviertassinari Can you let me know where I can add this?
Answering my own question: https://github.com/SublimeLinter/SublimeLinter-rubocop/blob/master/linter.py#L44
@rpbaptist Oliver's changes were made here, though note that this is a temporary fix to the issue, and will prevent you from being able to getting automatic updates from SublimeLinter-rubocop.
I think Bundler support or a way to easily modify the command without having to hack linter.py
would be very useful. In our case, we're using CodeClimate which uses a fixed version of Rubocop, usually lagging behind the latest release. To get the same warnings locally, we have to set the same Rubocop version in our Gemfile. Of course, we could force everyone to have the correct version of Rubocop installed globally, but that's unwieldy. So consider this a +1 for sorting this out.
Perhaps this should be handled by SublimeLinter itself, if the preferred solution is simply to let users set their own command (like Sublime RuboCop does)?
I'm at the limit of my sublime linter knowledge. This will affect #9.
In ruby land we have ton of different ways to configure our setups and choose ruby versions and library paths. I'd like to support more of them.
Current Support
rubocop
)bundle exec rubocop
ruby-rvm-env -S rubocop
works as does some symlinking see https://github.com/wayneeseguin/rvm/issues/3274#issuecomment-71536404 chooses the right ruby and the gemset's rubocop this works around rvm's hooking tocd
ruby-rvm-env -S bundle exec rubocop
)I've included the commands we'd need to run for the situations I know of. What's a good pattern to allow configuration of this?