[Fix #7885] Re-use LineLengthHelp for statement modifiers #7926
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.
This is a new attempt at a PR that was first made in #7924. The changes are pretty much the same but the description should be more correct this time.
There's no reason to have two implementations of the same logic. They weren't exactly the same, but I think the one in
LineLengthHelp
was correct, apart from falling back toLayout/IndentationWidth:Width
ifLayout/IndentationStyle:IndentationWidth
isnil
, which is now added to match the description of theLayout/IndentationStyle
parameters indefault.yml
.Added some examples on line length with tabs indentation in
line_length_spec.rb
.Updated
if_unless_modifier_spec
to cover the fallback onLayout/IndentationWidth:Width
better, and removed an example that could not happen in real execution ("without any IndentationWidth config"). The spec examples now work like before, but without requiringLayout/IndentationStyle
to be disabled.