-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
AutocorrectLogic#safe_autocorrect?
may be returning true erroneously
#11715
Labels
Comments
@koic, could you take a look at this? I am concerned Standard may be running unsafe autocorrections as a result 😬 |
Yeah, I'll look into it later. Thank you for the feedback! |
koic
added a commit
to koic/rubocop
that referenced
this issue
Mar 23, 2023
Fixes rubocop#11715. There was an issue where the default configuration was not loaded when instantiating cop with no arguments. This patch ensures default configuration by passing `RuboCop::ConfigLoader.default_configuration` to `RuboCop::Config.new` default argument.
8 tasks
This looks like unexpected behavior. Either way I think it's a bug and opened #11729 as a patch. |
bbatsov
pushed a commit
that referenced
this issue
Mar 23, 2023
Fixes #11715. There was an issue where the default configuration was not loaded when instantiating cop with no arguments. This patch ensures default configuration by passing `RuboCop::ConfigLoader.default_configuration` to `RuboCop::Config.new` default argument.
Thanks!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It appears like
safe_autocorrect?
may be returningtrue
for cases where autocorrection is not safe.For example, Lint/BooleanSymbol supports autocorrection, but the docs report that it is unsafe. Additionally, the RuboCop's default.yml agrees and has
SafeAutoCorrect: false
.However, if you were to instantiate the cop and ask if it was safe, it would return true:
Is this a bug? It's affecting which cops Standard thinks are safe to autocorrect, so I'm trying to find the proper way to ascertain whether a violation is safely autocorrectable programmatically.
Thank you for all your hard work!!! 💚
The text was updated successfully, but these errors were encountered: