-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Make SendNode#macro?
aware of struct constructor
#141
Make SendNode#macro?
aware of struct constructor
#141
Conversation
SendNode#macro?
SendNode#macro?
aware of struct constructor
4fc1057
to
008a5c9
Compare
Very good. I consider that a bugfix. Only thing I'm wondering... Should we not include I looked at the code in the main gem, and there is one I think it would be best to deprecate |
This PR makes `SendNode#macro?` and `RuboCop::AST::Node#class_constructor?` aware of struct constructor and `RuboCop::AST::Node#struct_constructor?` is deprecated. Like class constructor, struct constructor will be recognized as a macro and will be awakened in the following `private` modifier: ```ruby Foo = Struct.new(:foo) do private def private_foo foo end end ``` With this change, this PR aims to resolve the following issue. rubocop/rubocop#8919
008a5c9
to
ca2da26
Compare
Thank you for your review. I updated this PR with the suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the change.
Perfect, thanks! |
Released in 1.0.1 |
@marcandre Wow! Thank you for the quick release ❤️ |
Fixes rubocop#8919 and follow rubocop/rubocop-ast#141. This PR requires rubocop-ast 1.0.1 to awaken of struct constructor. And it will also add a reproduction test for rubocop#8919
Of course. FWIW, I intend to release bug fixes within a day of merging. It's so easy to do a release and there's not that many PRs for |
Follow up rubocop/rubocop-ast#141. `RuboCop::AST::Node#struct_constructor?` has been deprecated and merged into `RuboCop::AST::Node#class_constructor`.
This PR makes
SendNode#macro?
aware of struct constructor.Like class constructor, struct constructor will be recognized as a macro and will be awakened in the following
private
modifier:With this change, this PR aims to resolve the following issue.
rubocop/rubocop#8919