Closed maksimf closed 8 years ago
We lose the directory part of the file's path when we send it to rubocop. SublimeLinter does this to support unsaved files. I've been exploring a patch to use in our linter to recreate the directories in tmp
for the very related #10 about railscops.
Should this config work then?
AllCops:
RunRailsCops: true
Exclude:
- schema.rb
Documentation:
Enabled: false
Metrics/MethodLength:
Max: 20
I think, but only in the linter. If you run rubocop from the command line (or in a CI server) it might not match.
And due to #10 the rails cops wont work yet.
I'm having the same issue.
I even tried to specify the filename usign - '*_spec.rb'
with no luck.
# Removing BlockDelimiters Cop for RSpec
Style/BlockDelimiters:
Exclude:
- 'spec/**/*'
- '*_spec.rb'
I have
.rubocop.yml
:And so I expect linter to ignore
db/schema.rb
which it doesn't. I asked guys from rubocop and they told me that I need to specify--force-exclusion
flag to make linter work, which i did in mySublimeLinter.sublime-settings
:But this doesn't work. I ran linter in debug mode and figured out that it uses the following command:
/usr/local/opt/rbenv/shims/ruby -S rubocop --force-exclusion --config=/Users/m.filippov/myproject/.rubocop.yml db/schema.rb
And when I run this command in console manually, then everything works just fine, schema.rb is skipped. Do you have any idea what can be wrong?