-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Style/Alias
doesn't allow any use of alias
#1460
Comments
Fixed `Style/Alias` cop to allow the use of `alias` in lexical class and module scope, as the style guide does not forbid it.
I see the PR wasn't merged. In I don't really understand cop internals, so I can't tell what it's doing wrong. |
@marxarelli disappeared and I didn't have time to work on this myself. Someone else will have to drive the work here to completion. Basically, now the cop reflects an older version of the style guide. |
I'm happy to help with some guidance.. I understand the ruby and the parser, but would need some help getting that into a tested coo B mobile phone
|
Sure. You can start work on this and we'll lend you all the help you need. |
@alexdowad Yay! 🌈 ❤️ ✨ 💯 |
Sorry about being a total flake on this one. I'm glad it got done by @alexdowad ! |
I think the default should be prefer_alias_method. That was the behaviour before and upgrading a minor release should not break that expectation. |
According to comments in rubocop/ruby-style-guide#377
alias
is not strictly forbidden by the style guide and in fact can be more appropriate thanalias_method
in some cases—usually those involving lexical scope and a clear indirection to methods within the same scope. TheStyle/Alias
cop needs refactoring to allow the use ofalias
in cases such as the following.The text was updated successfully, but these errors were encountered: