SublimeLinter / SublimeLinter-rubocop

SublimeLinter 3 plugin for Ruby, using rubocop.
MIT License
159 stars 40 forks source link

Better path handling by using --stdin, and guessing unsaved file paths #29

Closed mhaylock closed 8 years ago

mhaylock commented 8 years ago

This PR is 100% inspired by @mattbrictson's comment on Issue #10.

I've taken his suggestion to use Rubocop's --stdin option and implemented the following:

That last change means that if you create a new file it is no longer always linted with the default rubocop config, it will use the projects rubocop config (or at least those in the root of the project) if possible.

In my testing these changes mean there are no longer any issues with relative paths when used for inherit_from, Include or Exclude. Also contextual cops now work, so this fixes #10.

This will also make #27 unnecessary, and thankfully means that unsaved changes can still be linted.

reconbot commented 8 years ago

This is beautiful, fix up the linting issues and I'll merge and release a new version

mhaylock commented 8 years ago

@reconbot fixed now - sorry, I was using Sublimelinter-flake8 and Sublimelinter-pep257 and those two errors didn't show up for some reason. Running both from the command line I could see those errors, and have fixed.

reconbot commented 8 years ago

v2.0.0 should be hitting package control in a few hours =)

mhaylock commented 8 years ago

@reconbot thank you for the quick release! Saw it come through package control a while ago 😊