rubocop / vscode-rubocop

The official VS Code extension for the RuboCop linter and code formatter.
https://marketplace.visualstudio.com/items?itemName=rubocop.vscode-rubocop
Other
51 stars 2 forks source link

Support `rubocop.safeAutocorrect` option #2

Closed koic closed 1 year ago

koic commented 1 year ago

Follow up https://docs.rubocop.org/rubocop/1.54/usage/lsp.html#autocorrection.

This PR makes vscode-rubocop supports safeAutocorrect option controls the safety of autocorrections. By default, it is enabled to perform safe autocorrections. If you disable it, unsafe autocorrections will also be performed, you can disable it here:

Or, in settings.json:

"rubocop.safeAutocorrect": false,

This option requires RuboCop 1.54+ because initializationOptions.safeAutocorrect param was introduced in the RuboCop version.