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
False positive of Style/IfUnlessModifier
with tabs indentation
#7885
Comments
@AlexWayfer can you please provide some extra information on this.
Why does this not fit on one line? Does the correction exceed your configured max line length? I'm not sure how this is related to tab indentation. |
Because the text is larger than max length of line. I don't know how to answer. Look at the right red arrow, it's wrap guide, 80 chars. You can copy pasted text and calculate a size.
Did you see a note about #5785 in the issue description? Tab is single character, but its size is configurable, and size of tab is not equal size of indentation. For example: |
When calculating how wide the indentation is, we must look at the `EnforcedStyle` of the `Layout/IndentationStyle` cop. If it's `spaces`, then the indentation multiplier is 1. If it's `tabs` it's a bit more complicated, but that part was already handled correctly. The specs needed to be updated with correct configuration for all cases with `tabs` indentation. Whether or not we should consider the `Enabled` parameter is debatable. I've chosen to not care about `Enabled`, and to use the other parameter settings in any case.
…_indentation [Fix #7885] Re-use LineLengthHelp for statement modifiers
Hello.
I'm trying to update RuboCop to version 0.82.0 for Flame.
I'm using tabs in this project.
And there is a condition which does not fit in one line.
Probably related to #5785
Expected behavior
No offenses.
Actual behavior
Offense from
Style/IfUnlessModifier
.Steps to reproduce the problem
RuboCop version
/cc @DracoAter
The text was updated successfully, but these errors were encountered: