SublimeLinter / SublimeLinter-rubocop

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

Rails cops in Rubocop, not working on temp. files outside the project #7

Closed yar closed 10 years ago

yar commented 10 years ago

Rails style checks do not work in rubocop, because the temporary file is opened outside of the Rails structure. Rubocop cannot tell whether that file is a model, a controller etc.

According to http://sublimelinter.readthedocs.org/en/latest/linter_attributes.html?highlight=tempfile_suffix#tempfile-suffix:

Some linters can only work from an actual disk file, because they rely on an entire directory structure that cannot be realistically be copied to a temp directory (e.g. javac). In such cases, you can mark a linter as “file-only” by setting tempfile_suffix to '-'.

Do you think it is a good idea to execute rubocop checks in the actual project directory, triggered on load/save rather than edit?

aparajita commented 10 years ago

Same as #6. In the future please check existing issues first.