linter-rubocop
linter-rubocop copied to clipboard
Autodetect different rubocop binary for different projects
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?
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.
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?
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 cd
ing there in a shell.
@blowfishpro, Thank you for your suggestion, Joseph!! very useful.
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 ascd
ing there in a shell.
This should be in the documentation.