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

Autocorrecting with rubocop by default is not proportionate #51782

Merged
merged 1 commit into from May 11, 2024

Conversation

dhh
Copy link
Member

@dhh dhh commented May 11, 2024

#50506 introduced the power to autocorrect generator output with Rubocop automatically. That's a very cool idea for people who have a style guide that diverges from what we ship with by default. But it's overkill for the default case where people use the default style guide, and it introduces both delay and console output as a cost. So let's just suggest this as an option, but not have it turned on by default.

@rails-bot rails-bot bot added the railties label May 11, 2024
@dhh dhh added this to the 7.2.0 milestone May 11, 2024
@dhh dhh merged commit 990432f into main May 11, 2024
6 checks passed
@dhh dhh deleted the turn-off-rubocop-autocorrect-by-default branch May 11, 2024 15:52
fractaledmind pushed a commit to fractaledmind/rails that referenced this pull request May 13, 2024
@koic
Copy link
Contributor

koic commented May 13, 2024

That's interesting. I've made adjustment and opened #51808.

rafaelfranca pushed a commit that referenced this pull request May 13, 2024
Follow up #51782.

> But it's overkill for the default case where people use the default style guide,
> and it introduces both delay and console output as a cost.

When there are no offenses with the coding style generated by code generation,
outputting RuboCop results to the console was redundant.
Since RuboCop has `--format=quiet` option that suppresses console output
when there are no offenses, this PR adds that option:
https://docs.rubocop.org/rubocop/1.63/formatters.html#quiet-formatter

While this PR doesn't resolve any added execution speed by RuboCop,
the frequency of using the generator is not high within the development flow.
Therefore, depending on the execution speed, it might be possible to uncomment #51782,
but this PR respects the defaults in #51782 and doesn't address that.
dhh pushed a commit that referenced this pull request May 14, 2024
Follow up #51782.

> But it's overkill for the default case where people use the default style guide,
> and it introduces both delay and console output as a cost.

When there are no offenses with the coding style generated by code generation,
outputting RuboCop results to the console was redundant.
Since RuboCop has `--format=quiet` option that suppresses console output
when there are no offenses, this PR adds that option:
https://docs.rubocop.org/rubocop/1.63/formatters.html#quiet-formatter

While this PR doesn't resolve any added execution speed by RuboCop,
the frequency of using the generator is not high within the development flow.
Therefore, depending on the execution speed, it might be possible to uncomment #51782,
but this PR respects the defaults in #51782 and doesn't address that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants