Layout/DotPosition for config/ruby-1.8.yml
pboling opened this issue · 3 comments
# Ruby 1.8.7 needs the . on chain of method calls at the end of a line
Layout/DotPosition:
EnforcedStyle: trailing
But in base.yml
we have:
Layout/DotPosition:
Enabled: true
EnforcedStyle: leading
Thus we need to add the override in config/ruby-1.8.yml
@searls Why did you disable the rule instead of enforcing trailing
for Ruby 1.8. There is a rule that enforces the style that Ruby 1.8 needs. Turning off the cop doesn't accomplish anything w.r.t. Ruby 1.8 compatibility.
Because leading dots is the designated Standard rule, and when it's not possible we won't enforce the opposite. I would not want to enable a rule enforcing the opposite for 1.8 only to enforce users churn to the opposite in 1.9. In general if a cop isn't supported in a version of Ruby, we will disable the cop rather than force people to change their code style again upon upgrade.
But trailing is the only one that even works on 1.8, so the churn is unavoidable. If they have multi-line chains in a code base supporting Ruby 1.8 they must be using trailing dots. There is no other option but to churn.
In general if a cop isn't supported in a version of Ruby, we will disable the cop rather than force people to change their code style again upon upgrade.
This is not a valid argument in this case.