standardrb/standard

VSCode is giving me StandardRb issues (expected) and Rubocop issues (unexpected)

germs12 opened this issue ยท 6 comments

I have removed Rubocop from my project and added StandardRb. I can have VSCode lint my files (and correct them) and it works as expected, but then moments later (sometimes 20 seconds, other times a couple minutes later) it will start reporting Rubocop issues that conflict with the StandardRb rules. Any idea how to get VSCode to just use StandardRb and ignore Rubocop?

I have searched the repo for anything rubocop and turned it off, but still no luck.

This is my .standard.yml

ruby_version: 3.2

plugins:
  - standard-rails

My gemfile has the following:

gem "standard", group: [:development, :test]
gem "standard-rails", group: [:development, :test]

In VSCode I have Ruby LSP installed and StandardRb. I do not have any Rubocop extensions install. Very frustrated. :)

Edit:

One clear example is double quotes vs single quotes. StandardRb gives me double quotes, but then I get an error that is should be single quotes.

...I think this is because I had the Ruby LSP installed. Uninstalling it fixed the issue. (yay).

searls commented

There is a setting on Ruby LSP to disable RuboCop.

We plan to add Standard support to it as well this year

For anyone else who finds this issue, the quick fix for Ruby LSP is to open its Extension Settings...

Screenshot 2023-10-13 at 15 55 03

"Edit in settings.json" the list of enabled LSP features...

Screenshot 2023-10-13 at 15 54 49

Set "diagnostics" to "false" and save.

Screenshot 2023-10-13 at 15 56 29

For anyone else who finds this issue, the quick fix for Ruby LSP is to open its Extension Settings...

Screenshot 2023-10-13 at 15 55 03 "Edit in settings.json" the list of enabled LSP features... Screenshot 2023-10-13 at 15 54 49 Set "diagnostics" to "false" and save. Screenshot 2023-10-13 at 15 56 29

Thank you very much @jamiemccarthy . It would be good to include this in the Readme of this repository because it is really tricky to find how to disable robocop in rubyLsp. And most devs probably don't want to remove ruby-lsp extension completely.

Similarly, any update on adding Standard support to the now default ruby-lsp VSCode extension?

@davidcelis -- would love for someone to contribute this. I took a quick stab at it, but since I likely wouldn't use it myself I gave up at the first roadblock.