Skip to content
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

Layout/DotPosition for config/ruby-1.8.yml #561

Closed
pboling opened this issue May 16, 2023 · 3 comments
Closed

Layout/DotPosition for config/ruby-1.8.yml #561

pboling opened this issue May 16, 2023 · 3 comments

Comments

@pboling
Copy link
Contributor

pboling commented May 16, 2023

# 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 searls closed this as completed in c00a996 May 24, 2023
@pboling
Copy link
Contributor Author

pboling commented May 25, 2023

@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.

@searls
Copy link
Contributor

searls commented May 25, 2023

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.

@pboling
Copy link
Contributor Author

pboling commented May 25, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants