-
Notifications
You must be signed in to change notification settings - Fork 1
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
Only not risky autofixes #381
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd stick with Rails default. Which will run with -A
.
See https://github.com/rails/rails/blob/15ddce90583bdf169ae69449b42db10be9f714c9/railties/lib/rails/configuration.rb#L138
But they have a very limited ruleset. We may break things because we use way more rules. |
And it's not default anymore: https://github.com/rails/rails/pull/51782/files |
Let's see: rails/rails#53138 |
I think this can be entirely removed anyway. Rails does it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me is either we don't do anything, or I am ok with the -A
. I have enough code coverage everywhere to catch bugs. I'd rather do that than manually adjust rubocop offenses. But if more people think otherwise I can live with that.
I added some more people, so that we can come to a conclusion on this PR. |
It's not about your code though but about generated code for a new project, which may subtly fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I very much agree with the comment in rails/rails#53138 (comment) that if you want to automatically apply unsafe cops you can just mark them as safe.
So running rubocop automatically should be done with -a
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To my understanding this is a one-off run of rubocop right after initializing a new, empty project. It seems very unlikely to have unsafe things to fix, but if it somehow does, I agree it would be better not to fix them at that point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Mike in that, being a one-off when creating a new project, I'd rather rubocop not break anything, as there are many initial-setup things that could already be misconfigured.
Afterwards, if bin/check
goes for the risky fixes I wouldn't mind because they'd be easier to identify
Risky autofixes shouldn't be needed, I guess.