vscode-ruby version: 0.27.0anyasdf1.43.2macOS 10.14.6useLanguageServer is true in your configuration?) Yes>0.72.0"ruby.lint": {
"rubocop": {
"lint": true,
"rails": true
}
},
Adding this to my configuration should enable linting with rubocop, with rails cops enabled.
Language Server Output:
Lint: executing rubocop -s <file> -f json -R -l...
invalid option: -R
The new way to use rails cops is to install the rubocop-rails gem and run RuboCop with rubocop --require rubocop-rails
I can make a PR for this to swap out the argument, but to maintain compatibility with older rubocops it may become more complicated.
Is there a config file based workaround for this in the meantime?
I've tried downgrading to 0.71 but it throws a few requirement errors for some other gems.
Actually, got it working with a mix of older gem versions:
gem "rubocop", "0.71"
gem "rubocop-rails", git: "https://github.com/rubocop-hq/rubocop-rails", tag: "v2.0.1"
But obviously, support for the latest versions would be preferred. I'm new to VSCode, so I'll have a poke around how extensions work and see if I can muddle a PR together at some point.
@jordanbrock Here's what I did to get linting working with rubocop >0.71
"rails": true from settings.jsonrequire: rubocop-rails to my .rubocop.yml config file as per: https://github.com/rubocop-hq/rubocop-rails#rubocop-configuration-fileThis issue has not had activity for 30 days. It will be automatically closed in 7 days.
I can make a PR to update the docs later this week with the suggestion from @abraham-chan
This issue has not had activity for 30 days. It will be automatically closed in 7 days.
Most helpful comment
@jordanbrock Here's what I did to get linting working with rubocop >0.71
"rails": truefrom settings.jsonrequire: rubocop-railsto my.rubocop.ymlconfig file as per: https://github.com/rubocop-hq/rubocop-rails#rubocop-configuration-file