Vscode-ruby: Rubocop Ignored Files Not Respected

Created on 19 Apr 2020  路  2Comments  路  Source: rubyide/vscode-ruby

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: 2.6.5
  • Ruby version manager (if any): rvm
  • VS Code version: 1.44.2
  • Operating System: Mac OS 10.15.4
  • Using language server? Yes

Expected behavior

Ignored files specified in the AllCops.Exclude list in .rubocop.yml are respected, when Rubocop linting is run by the extension.

Actual behavior

The ignored files list is not being respected. The extension is underlining code due to a Rubocop violation. However, the entire file should have been excluded (and it is indeed excluded when I run rubocop directly on the command line).

In my case, I ignored all DB migration files, as in db/migrate/*. Looks like this isn't getting picked up properly by the extension.

Thank you.

stale

Most helpful comment

I had a similar issue. After a little digging I found that the forceExclusion option fixes this issue for me (it essentially tells Rubocop to honor Excludes in the config).

You can enable it in VS Code's settings.json as follows:

  "ruby.lint": {
    "rubocop": {
      "forceExclusion": true
    }
  },

All 2 comments

I had a similar issue. After a little digging I found that the forceExclusion option fixes this issue for me (it essentially tells Rubocop to honor Excludes in the config).

You can enable it in VS Code's settings.json as follows:

  "ruby.lint": {
    "rubocop": {
      "forceExclusion": true
    }
  },

This issue has not had activity for 30 days. It will be automatically closed in 7 days.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wingrunr21 picture wingrunr21  路  4Comments

ecbrodie picture ecbrodie  路  5Comments

webmastak picture webmastak  路  4Comments

ghost picture ghost  路  4Comments

archfish picture archfish  路  5Comments