Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rubocop autocorect / autocorrect-all #1726

Closed
1 task done
KevinBerthier opened this issue Oct 19, 2023 · 3 comments
Closed
1 task done

Rubocop autocorect / autocorrect-all #1726

KevinBerthier opened this issue Oct 19, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request transferred This issue was transferred from vscode-ruby-lsp

Comments

@KevinBerthier
Copy link

This feature is VS Code specific

  • VS Code specific

Use case

When using format on save, rubocop seems to run with --autocorrect option, but some people might want to use --autocorrect-all (for example frozen_string_literal comment is not added on safe autocorrect)

Description

Add an option to set --autocorect-all

Implementation

Could be a text field for rubocop options or a boolean for rubocopAutocorrectAll

@KevinBerthier KevinBerthier added the enhancement New feature or request label Oct 19, 2023
@andyw8
Copy link
Contributor

andyw8 commented Oct 19, 2023

BTW you can add SafeAutoCorrect: true to a cop's configuration if you want it to always auto-correct. We do that in our Shopify's own config:

https://github.com/Shopify/ruby-style-guide/blob/4ae6412d0b6324b1d1c94302b398ac8af69eb6b2/rubocop.yml#L548C1-L548C1

@vinistock vinistock self-assigned this Oct 30, 2023
@vinistock
Copy link
Member

vinistock commented Oct 30, 2023

Thank you for the feature suggestion! This is a duplicate of #704, so I'm going to close in favour of that one to keep discussions centralized.

Because the Ruby LSP supports multiple formatters/linters, I think we need to expose a generic configuration for "linter/formatter flags" that people can use to configure their specific linter however they prefer.

@jhirn
Copy link

jhirn commented Jan 25, 2024

BTW you can add SafeAutoCorrect: true to a cop's configuration if you want it to always auto-correct. We do that in our Shopify's own config:

And there was much joy. So glad I found this posts. My chilly strings thank you greatly!

@st0012 st0012 transferred this issue from Shopify/vscode-ruby-lsp Mar 18, 2024
@st0012 st0012 added the transferred This issue was transferred from vscode-ruby-lsp label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request transferred This issue was transferred from vscode-ruby-lsp
Projects
None yet
Development

No branches or pull requests

5 participants