misogi / vscode-ruby-rubocop

Rubocop extension for Visual Studio Code
https://marketplace.visualstudio.com/items/misogi.ruby-rubocop
MIT License
137 stars 68 forks source link

Could we have a "Ruby: safe autocorrect by rubocop" command? #101

Open tchiaspko opened 5 years ago

tchiaspko commented 5 years ago

Currently when using the command pallett, the following is avaiable Ruby: autocorrect by rubocop

Could we have a SAFE version of this (i.e. Ruby: autocorrect by rubocop) that run "rubocop --safe-auto-correct" instead of "rubocop --auto-correct" which may have unsafe changes?

AlecRust commented 4 years ago

The behaviour of rubocop --auto-correct has changed (https://github.com/misogi/vscode-ruby-rubocop/issues/123) in Rubocop such that this extension now only runs safe cops.

I've raised https://github.com/misogi/vscode-ruby-rubocop/pull/127 to bring this "autocorrect all" behaviour back. But probably the ideal solution is to run --auto-correct by default as it currently does, with an option to run unsafe cops with --auto-correct-all.

Kayyow commented 3 years ago

I just submitted a PR to allow the usage of rubocop with the --auto-correct-all flag under an extension configuration option : #153