-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
on_index, on_indexasgn, on_lambda callbacks seem to be missing? #43
Comments
First time I hear about those callbacks. :-) I guess we'll need to update |
I will totally try to take a stab at this then! |
Hi! I can try to have a look! |
They were only added a few months back. A lot of good work being done on parser. 🙂 |
After checking a while, I am not feeling confident to understand what's going on with AST, and therefore apply these 3 rules. Sorry |
Thanks anyway @Ruffeng. Feel free to chip in on other parts of the codebase. 🙂 |
Hi @bbatsov and @Ruffeng , I'm trying to tackle this. I think the reason for the missing callbacks is that the most recent AST format is opt-in: https://github.com/whitequark/parser#usage This has two consequences:
Once that is done, the following tests do pass: https://github.com/paolobrasolin/rubocop/commit/02ef76c9a691f2c2da58b1a7aa952b595d536cee#diff-a5c2712427b22a714e59aaebd99527c1 There is good reason for the feature to be opt-in: it is breaking, and in fact 268 specs fail. The reason can be deduced by the documentation in https://github.com/whitequark/parser/blob/master/lib/parser/builders/default.rb. TL;DR:
So presumably there is fixing to do wherever there is some assumption on the emission of trees like these. I think this broadly defines the direction for a solution, but there clearly is a bunch of work to do.
Thanks. ❤️ |
FYI, the missing NODETYPES have just been added. |
Thanks @marcandre! This will make things easier and much cleaner when I get back on this. |
Transferred to rubocop-ast. I'll handle it. |
Expected behavior
Have callbacks available for whitequark/parser@7d72eba and
_type?
Actual behavior
Above callbacks don't seem to be called for appropiate nodes
Steps to reproduce the problem
And a quick test with:
It appears that the callback is not being called, nor a
node
asindexasgn_type?
availableRuboCop version
I am fairly new to ruby and definitely to rubocop, so excuse the issue / vs potential PR, I would love to contribute with some tips!.
The text was updated successfully, but these errors were encountered: