Skip to content

Let the RuboCop template favor readability over terseness - #235

Open
OutlawAndy wants to merge 1 commit into
masterfrom
fix/rubocop-readability
Open

OutlawAndy wants to merge 1 commit into
masterfrom
fix/rubocop-readability

Conversation

@OutlawAndy

Copy link
Copy Markdown
Member

Why?

The template's .rubocop.yml forced two styles that hurt readability, and its line-length limit mostly produced awkward wraps.

  • Style/ItBlockParameter: always rewrites every one-argument block to it, including long ones. The result is RSpec.configure do followed by it.include … and it.before … many lines down.
  • Style/EndlessMethod: require_single_line turns every one-line method body into an endless method, whether or not it reads better that way.
  • Layout/LineLength (120) mostly produced wrapped comments and strings that were harder to read than the long line.

What Changed

  • Removed the Style/ItBlockParameter and Style/EndlessMethod overrides. RuboCop's own default for both is allow_single_line: it only in single-line blocks, and endless methods allowed on one line but never required.
  • Disabled Layout/LineLength.

Pre-merge checklist

  • Update relevant READMEs (none mention these rules)

Notes

rubocop -A can't restore a parameter name to a multi-line block that already uses it. Apps that already autocorrected under the old config will see Style/ItBlockParameter offenses until those names are put back by hand.

🤖 Generated with Claude Code

`it` is now allowed only in single-line blocks, so multi-line blocks
name their parameter (`RSpec.configure do |config|`, not `it.include`).
Endless methods are allowed on one line but no longer required. Both
are RuboCop's own defaults, which the template had overridden.

Layout/LineLength is off: wrapping a line to fit a limit rarely made
it easier to read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant