Repository navigation
Let the RuboCop template favor readability over terseness - #235
Open
OutlawAndy wants to merge 1 commit into
Open
OutlawAndy wants to merge 1 commit into
OutlawAndy wants to merge 1 commit into
Conversation
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
The template's
.rubocop.ymlforced two styles that hurt readability, and its line-length limit mostly produced awkward wraps.Style/ItBlockParameter: alwaysrewrites every one-argument block toit, including long ones. The result isRSpec.configure dofollowed byit.include …andit.before …many lines down.Style/EndlessMethod: require_single_lineturns 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
Style/ItBlockParameterandStyle/EndlessMethodoverrides. RuboCop's own default for both isallow_single_line:itonly in single-line blocks, and endless methods allowed on one line but never required.Layout/LineLength.Pre-merge checklist
Notes
rubocop -Acan't restore a parameter name to a multi-line block that already usesit. Apps that already autocorrected under the old config will seeStyle/ItBlockParameteroffenses until those names are put back by hand.🤖 Generated with Claude Code