Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Autodetect different rubocop binary for different projects #283

Open
phlegx opened this issue Oct 19, 2018 · 5 comments
Open

Autodetect different rubocop binary for different projects #283

phlegx opened this issue Oct 19, 2018 · 5 comments

Comments

@phlegx
Copy link

phlegx commented Oct 19, 2018

I'm using RVM (Ruby version manager) to manage my ruby installations and and to manage the bundler gem sets. It would be handy that linter-rubcop could detect the proper Rubocop binary depending on the project I have opened in Atom. Is there a way that linter-rubocop package can handle that?

@danmayer
Copy link

yeah this has become a big issue for using atom rubocop as I have a bunch of different projects that are all on different ruby versions. So when I have open two at once there is a high likelyhood that one is showing rubocop errors.

@vzamanillo
Copy link
Contributor

vzamanillo commented May 30, 2019

It is a good proposal, that involves

  • the execution of rvm-exec current to know which is the current gemset (ex: 2.3.1, needs .rvmrc)
  • the execution of Rubocop in the current gemset with rvm 2.3.1 do rubocop

does anyone know another or better approach?

@blowfishpro
Copy link

I was actually able to get this to work by just changing Atom's config for linter-rubocop. This works for RVM, not sure if other ruby version managers have an equivalent

"*":
  "linter-rubocop":
    command: "rvm in . do rubocop"

The key point here is that linter-rubocop executes with the right working directory, but that doesn't have the same effect as cding there in a shell.

@vzamanillo
Copy link
Contributor

@blowfishpro, Thank you for your suggestion, Joseph!! very useful.

@73
Copy link

73 commented Jun 4, 2021

I was actually able to get this to work by just changing Atom's config for linter-rubocop. This works for RVM, not sure if other ruby version managers have an equivalent

"*":
  "linter-rubocop":
    command: "rvm in . do rubocop"

The key point here is that linter-rubocop executes with the right working directory, but that doesn't have the same effect as cding there in a shell.

This should be in the documentation.

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

No branches or pull requests

5 participants