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
v1 default: Include Safe: false by default #8156
Comments
That's a fair question. I guess by now most unsafe cops (at least those that are really problematic) have been marked as unsafe. I'm afraid that if we make unsafe the default, we'll have to make every existing cop without a default safe anyways, otherwise this would be a huge changes of the current behaviour (unless someone wants to carefully audit each cop, that is). |
Are you talking about the default for Cops? Or for the CLI? The Cops are Safe by default, but the CLI is currently unsafe by default. I assumed that assuming Cops to be safe by default was ok, my question is about if the CLI |
Ops, I got confused then. I thought we were discussing the cops in general. For the CLI probably safe auto-correct is a better default, although I'm wary of adding something named |
How about |
Sounds reasonable to me. |
…ault. `-a` / `--auto-correct` are now safe only, replacing `--safe-auto-correct` `-A` / `--auto-correct-all` apply safe and unsafe corrections
This broke the default autofix for Also, this change broke a few other tools like Ale dense-analysis/ale#3237, I'm unable to make this work until the fix their default. Is there something I can do in the meantime in the |
Sorry for the troubles you are having @paul. Thanks for reaching out. You can override the settings per cop with Style/FrozenStringLiteralComment:
Safe: true
SafeAutoCorrect: true There are a few open issues that I hope will make it more obvious what is going on. We are planning on documenting why a cop isn't safe (e.g. |
@bbatsov wrote in #5980 about
--safe-auto-correct
Now would be a good time to ask ourselves if the current default is the right one. safe or unsafe by default?
rubocop -a
does all autocorrections, including unsafe ones. One has to add--safe-auto-correct
to exclude unsafe ones.Should this be the default, or should it be the reverse?
The text was updated successfully, but these errors were encountered: