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

Only not risky autofixes #381

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Only not risky autofixes #381

wants to merge 2 commits into from

Conversation

schmijos
Copy link
Member

@schmijos schmijos commented Sep 25, 2024

Risky autofixes shouldn't be needed, I guess.

@schmijos schmijos requested a review from coorasse September 25, 2024 10:16
@schmijos schmijos self-assigned this Sep 25, 2024
Copy link
Member

@coorasse coorasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schmijos
Copy link
Member Author

schmijos commented Oct 1, 2024

But they have a very limited ruleset. We may break things because we use way more rules.

@schmijos schmijos requested a review from coorasse October 1, 2024 14:59
@schmijos
Copy link
Member Author

schmijos commented Oct 1, 2024

And it's not default anymore: https://github.com/rails/rails/pull/51782/files

@schmijos
Copy link
Member Author

schmijos commented Oct 1, 2024

Let's see: rails/rails#53138

@coorasse
Copy link
Member

coorasse commented Oct 8, 2024

I think this can be entirely removed anyway. Rails does it.

Copy link
Member

@coorasse coorasse left a 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.

@coorasse
Copy link
Member

I added some more people, so that we can come to a conclusion on this PR.

@rnestler
Copy link
Member

I have enough code coverage everywhere to catch bugs.

It's not about your code though but about generated code for a new project, which may subtly fail.

Copy link
Member

@rnestler rnestler left a 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.

Copy link
Contributor

@firemind firemind left a 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.

Copy link
Contributor

@ignaciosy ignaciosy left a 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

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.

6 participants