pderichs / sublime_rubocop

A Sublime Text RuboCop plugin.
238 stars 41 forks source link

Non .rb files are not auto-checked #33

Closed mtarnovan closed 9 years ago

mtarnovan commented 9 years ago

If I understand this code, auto-checks only run on .rb files. If not too complicated, I suggest parsing rubocop.yml and extracting the AllCops: Include and AllCops: Exclude rules, (see https://github.com/bbatsov/rubocop/blob/master/config/default.yml#L9-29) and use that in the is_ruby_file method.

If that's too complicated, adding some other extension to that list might be a good fallback (.gemspec, Gemfile, .rake etc).

Sorry for not sending a PR, I don't know Python. Kudos for a very useful plugin.

mtarnovan commented 9 years ago

Another good alternative would be to ask Sublime of the current file type is Ruby or Rails, I think that might be possible through the Sublime Plugin API.

vanhecke commented 9 years ago

+1

pderichs commented 9 years ago

@mtarnovan you are absolutely right - thanks for reporting that issue!

It should be fixed by now - I chose your second suggestion for a solution :wink: .

Glad you like the plugin :)

Cheers!

mtarnovan commented 9 years ago

@pderichs Thanks for the fix. I suggest adding RSpec.tmlanguage to the list of syntaxes recognized as Ruby.