pderichs / sublime_rubocop

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

.rubocop.yml is not honored when mark_issues_in_view is set to true #25

Open tmichel opened 10 years ago

tmichel commented 10 years ago

This is especially annoying with generated files such as schema.rb over which I do not have any control.

It would be really nice if the config file would be honored or I could toggle auto-check on a per-file basis.

Thanks.

pderichs commented 9 years ago

Sorry, I am not able to reproduce that.

Which version of ST are you using? Do you use rvm, rbenv or your own command?

Just making sure it is just a typo in your title: The file is correctly named .rubocop.yml, right? (note the point in front of rubocop)

tmichel commented 9 years ago

The title was only a typo. Sorry about that.

I'm using my own command, simply pointing at the binary with an absolute path. I'm using chruby, sublime text 3 beta (build 3065) on OS X.

The custom command was necessary because of OS X stupidity with paths.

pderichs commented 9 years ago

I changed the behavior of the rubocop runner class within the plugin. Can you test again with the latest version? Thank you.

pderichs commented 9 years ago

Update: I can confirm the problem now.

The plugin calls rubocop with the current file to update the marks in the view. If rubocop is called with a single file, it ignores the .rubocop.yml.

So this is a bug in the plugin :disappointed:

I have some ideas how to fix that and make a decision soon. Until then I would suggest turning the marks on and off depending on the file you are currently viewing. You can do that with the menu command "RuboCop: Toggle auto check".

kuon commented 9 years ago

I do experience the same issue with rbenv.

chuckbjones commented 6 years ago

What about using the --force-exclusion flag to rubocop? (Perhaps that flag didn't yet exist when this issue was created?)

chuckbjones commented 6 years ago

Looks like --force-exclusion was created just for this purpose: https://github.com/bbatsov/rubocop/issues/893