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

Proposal: change Style/Alias to prefer_alias_method (or disable) #185

Closed
timriley opened this issue Jun 20, 2020 · 2 comments · Fixed by #196
Closed

Proposal: change Style/Alias to prefer_alias_method (or disable) #185

timriley opened this issue Jun 20, 2020 · 2 comments · Fixed by #196
Labels
approved 👍 good first issue ⭐️ Good for newcomers rule change 👩‍⚖️ Suggest a style guide rule change

Comments

@timriley
Copy link
Contributor

Hi @searls and fellow standardrb-ers,

I was porting a gem to standardrb today when I noticed it auto-corrected an alias_method to alias.

I note that the following rules are currently in place for Style/Alias:

Style/Alias:
  Enabled: true
  EnforcedStyle: prefer_alias

Looking at the git blame for the base.yml file, it seems like this rule was never specifically tweaked, it was just brought in with the wholesale import of the original RuboCop defaults.

I would like to propose that we (a) change the enforced style to prefer_alias_method, or (b) disable the rule entirely.

As I was about to write my reasoning for this proposal, I actually found this recently opened issue on the Ruby Style Guide that sums up my thinking very well, so I'll point you to this first: rubocop/ruby-style-guide#821

Happy to discuss further, but I thought it'd be simplest just to point to that issue and gauge your feelings first.

Cheers!

@timriley timriley changed the title Proposal: Style/Alias Proposal: change Style/Alias to prefer_alias_method (or disable) Jun 20, 2020
@searls
Copy link
Contributor

searls commented Jun 23, 2020

I'm willing to buy it. (Having used either method less than a dozen times in 15 years makes me easily swayed). Send a PR?

@searls searls added the rule change 👩‍⚖️ Suggest a style guide rule change label Jun 23, 2020
@timriley
Copy link
Contributor Author

Thanks @searls! Will do 👍

jmkoni pushed a commit to jmkoni/standard that referenced this issue Sep 1, 2020
- Fixes standardrb#185
- Added line autocorrectable files to validate that the change happens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved 👍 good first issue ⭐️ Good for newcomers rule change 👩‍⚖️ Suggest a style guide rule change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants