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 linting violations even if suppressed via .rubocop_todo.yml #7

Open
NeoPhi opened this issue Aug 14, 2023 · 5 comments
Open

Show linting violations even if suppressed via .rubocop_todo.yml #7

NeoPhi opened this issue Aug 14, 2023 · 5 comments

Comments

@NeoPhi
Copy link

NeoPhi commented Aug 14, 2023

I have previously been using the rebornix.Ruby extension and one difference I'm finding with rubocop.vscode-rubocop is I'm not finding a way to see linting errors in the editor as if our .rubocop_todo.yml didn't exist. Is there a way to show violations and autofix on save even if they are suppressed via .rubocop_todo.yml? This helps with gradual migration of a legacy code base. Thank you.

@koic
Copy link
Member

koic commented Aug 14, 2023

By checking rubocop.autocorrect, autocorrect will be executed when saving on the VS Code editor. Will this resolve the issue?
https://github.com/rubocop/vscode-rubocop#rubocopautocorrect

@NeoPhi
Copy link
Author

NeoPhi commented Aug 14, 2023

Having autocorrect on does not fix any issues (even safe ones) when saving.

@koic
Copy link
Member

koic commented Aug 14, 2023

Hm, Can you show the version of RuboCop you're using?

@NeoPhi
Copy link
Author

NeoPhi commented Aug 14, 2023

Extension Version:

RuboCop v0.5.0

RuboCop version installed:

[client] Restarting language server...
[client] Starting language server: bundle exec rubocop --lsp
[server] RuboCop 1.56.0 language server initialized, PID 83228

@NeoPhi NeoPhi changed the title Linting ignoring .rubocop_todo.yml Show linting violations even if suppressed via .rubocop_todo.yml Aug 14, 2023
@NeoPhi
Copy link
Author

NeoPhi commented Aug 14, 2023

As a work around, I'm using the technique outlined here: rubocop/rubocop#10294 (comment)

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

2 participants