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

Fix Rubocop triggering when disabled #30

Closed

Conversation

mgoggin
Copy link

@mgoggin mgoggin commented Dec 12, 2022

Fixes an issue where Rubocop autocorrection will run even when disabled.

SETTINGS.rubocop.autocorrectOnSave() will return a string. When the 'Disabled' option is selected in the settings, this method returns the string 'Disabled' which is a truthy value.

We explicitly check the return value of autocorrectOnSave() to determine if we should bind the onDidSave event handler to the active text editor.

Fixes #29

Fixes an issue where Rubocop autocorrection will run even when disabled.

`SETTINGS.rubocop.autocorrectOnSave()` will return a string. When the 'Disabled' option is select in the settings, this method returns the string 'Disabled' which is a truthy value.
@mgoggin mgoggin closed this Oct 10, 2023
@mgoggin mgoggin deleted the fix-rubocop-on-save-activation branch October 10, 2023 20:27
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

Successfully merging this pull request may close these issues.

Rubocop autocorrect is running on save even when disabled
1 participant