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

Show Rubocop show warning without autoformatting #732

Closed
abrausch opened this issue Dec 10, 2024 · 2 comments
Closed

Show Rubocop show warning without autoformatting #732

abrausch opened this issue Dec 10, 2024 · 2 comments

Comments

@abrausch
Copy link

Hi,
is there a possibility to show some rubocop warning but ignore them for formatting? I had a problem with
Lint/UselessAssignment
which was removing the useless assignments when I saved the code.
To fix that I set it to false in my .rubocop.yaml
But I would like to see the warning inside my editor but because I save quite often I would like to disable this option for formatting.
Is this possible?

Greetings and thx
Alex

@danillos
Copy link

You can configure your project Rubocop config file for it.

https://docs.rubocop.org/rubocop/1.69/configuration.html#autocorrect

@castwide
Copy link
Owner

Modifying the Rubocop config file looks like the right option. I confirmed that I could enable a cop and disable its AutoCorrect setting so the warning appeared in the editor but formatting didn't change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants