vscode-ruby version: 0.12.1Make sure you have ruby, ruby-debug-ide and ruby-debug-basex19 installed before submitting your issue -- thank you !
Rubocop is only working with simple settings:
"rubocop": true
More complex settings like:
"rubocop": {
"lint": true,
"rails": true
}
Don't seem to work at all. No linting is happening
@chrisnicola
Ok just looked through the code to see what was happening... because I dunno... I guess I'm procrastinating...
Anyway so I suspect those settings are not doing what you think they are doing.
It's essentially running rubocop -f json --force-exclusion -l -R. Try running that against your file and see if it produces anything... I suspect it doesn't.
That's because that -l actually limits the set of rubocop checks to this much smaller set:
https://github.com/bbatsov/rubocop/tree/master/lib/rubocop/cop/lint
So I suspect what you actually want is:
"rubocop": {
"rails": true
}
And I think maybe the doc should be updated to make it clear what lint: true will do. I suspect to most reading that doc it seems like that's just what you specify if you want to enable Rubocop as that's what I looked like to me until I went diving into the code.
cc: @Vuneu @agamrp @al13bash @javiervidal because you gave the issue a thumbs up, so I'm guessing you ran into the same problem.
I can confirm that:
$ rubocop --force-exclusion -R -l
64 files inspected, 3 offenses detected
$ rubocop --force-exclusion -R
64 files inspected, 414 offenses detected
Thank you @gerrywastaken
Thanks @gerrywastaken I appreciate you taking the time to look into that.
@javiervidal @chrisnicola You are both very welcome. I think the docs should probably be updated to show what this option does.
@gerrywastaken I really appreciate your investigation and all your help here. I'll update the documentation.
Most helpful comment
@chrisnicola
Ok just looked through the code to see what was happening... because I dunno... I guess I'm procrastinating...
Anyway so I suspect those settings are not doing what you think they are doing.
It's essentially running
rubocop -f json --force-exclusion -l -R. Try running that against your file and see if it produces anything... I suspect it doesn't.That's because that
-lactually limits the set of rubocop checks to this much smaller set:https://github.com/bbatsov/rubocop/tree/master/lib/rubocop/cop/lint
So I suspect what you actually want is:
And I think maybe the doc should be updated to make it clear what
lint: truewill do. I suspect to most reading that doc it seems like that's just what you specify if you want to enable Rubocop as that's what I looked like to me until I went diving into the code.cc: @Vuneu @agamrp @al13bash @javiervidal because you gave the issue a thumbs up, so I'm guessing you ran into the same problem.