misogi / vscode-ruby-rubocop

Rubocop extension for Visual Studio Code
https://marketplace.visualstudio.com/items/misogi.ruby-rubocop
MIT License
137 stars 68 forks source link

Bundler Support #56

Closed erikdstock closed 7 years ago

erikdstock commented 7 years ago

This PR updates vscode-ruby-rubocop to set the rubocop command with the following precedence:

Using bundler resolves many errors around changes to cop namespaces and configuration as well- see #51 and #43

It also takes advantage of the (unused?) RubocopConfig interface and moves configuration into a separate file, addressing the todo to leverage the onDidChangeConfiguration vscode hook.

Still needs test updates and clarification on how bundler works in a windows environment.

damien commented 7 years ago

Looking good so far! I was originally trying to address this, but I haven't had the time/motivation to tackle it recently. Thanks for doing this!

erikdstock commented 7 years ago

No prob! I'm still interested to hear how the command should differ under windows (bundle exec rubocop.bat? bundle.bat exec rubocop?) But otherwise the RubocopConfig stuff should be pretty easy to test in isolation.

-Oh, and I'm not clear why the CI failed- it seems to have failed a test that I had removed... I'll look into that.

damien commented 7 years ago

@erikdstock I can't speak with certainty about the .bat executable interfaces, but the bundle exec command expects the name of a binary executable to run. If rubocop.bat is what win32 systems expect, we should probably continue to call rubocop in that way.

I'm not certain what a windows install of Rubocop would look like, but it does seem like something this project's CI suite should run against.

dkniffin commented 7 years ago

I'm looking forward to this feature. I hope it gets merged soon!

erikdstock commented 7 years ago

Just a bump here... I'm willing to say this PR is good to go, but maybe some folks want to check it out to review beforehand? Aside from the linked issues i've posted above I cannot find any consistent way of dealing with win32 support.

erikdstock commented 7 years ago

Just for the record, i have it tested with both bundler and executePath set to ...lib/ruby/gems/2.3.0/gems/rubocop-0.47.1/bin/ and it is working fine with both. Thanks for the review!

lstanden commented 7 years ago

+1 on this. Trying out VS Code after finding RubyMine melting my CPU, and would be great to have Bundler support.

damien commented 7 years ago

@misogi I think this PR is waiting on your 👍 or 👎 — thoughts?

misogi commented 7 years ago

This looks great to me too. I will check my environment, merge & release 0.5.0. Give me time.

misogi commented 7 years ago

RubocopConfig interface is great approach! I don't use extension in win32. I want to hear voice of win32 users.