pderichs / sublime_rubocop

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

Auto_correct on save #43

Open kinoute opened 8 years ago

kinoute commented 8 years ago

Hey,

I'm not sure it's implemented but would it be possible to auto correct the current file when saving, just like other plugins do (CodeFormatter etc)? It works well by using the command palette ("Rubocop: auto correct current file") but I'd like to do it automatically when saving. I didn't find what to add in the settings file to do so, am I missing something?

Here's my settings file:

{ "mark_issues_in_view": false, "show_auto_correct_warning": false }

(I still use SublimeLinter for linting).

Cheers

pderichs commented 8 years ago

Hi!

Currently the plugin does not have this functionality, but it would be a nice addition to it :+1:

Hendler commented 7 years ago

👍

terry90 commented 7 years ago

:+1:

gastonmorixe commented 6 years ago

+1

kinoute commented 5 years ago

Any news on this? It's a must have feature

amazing-jay commented 3 years ago

add this to your sublime user key bindings.

{ "keys": ["super+shift+s"], "command": "rubocop_auto_correct" }

doesn't run on normal save, only shift+ version

kinoute commented 3 years ago

@amazing-jay Funny you post here today, I was looking at this issue again earlier this morning, 5 years after my initial post.

I found this fork that adds the "auto-correct on save" feature: https://github.com/pabla/sublime_rubocop/commit/513c130896f54fda123fe151e080d60ca8b59863

I edited the plugin file manually and it works nicely.