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

Add Node classes for assignment types #201

Merged
merged 1 commit into from Aug 12, 2021

Conversation

dvandersluis
Copy link
Member

Adds nodes with a mostly unified interface for lvasgn, ivasgn, cvasgn, gvasgn, casgn, op-asgn, and-asgn and or-asgn nodes.

The idea here is that we have a lot of repeated boilerplate in some cops to handle assignment nodes that are mostly but not completely the same. This will allow all assignment nodes to respond to name and expression regardless of the node type.

I didn't create a node class for masgn because that works differently than everything else and I'm not exactly sure what we'd want there as of yet.

@dvandersluis
Copy link
Member Author

Once this is available I have some cops I'd like to update to make more simple. 😄

@marcandre
Copy link
Contributor

Great work 🎉

PR is great as is, but could you also update docs/modules/ROOT/pages/node_types.adoc please?

@dvandersluis
Copy link
Member Author

@marcandre absolutely! I actually had that file open to use as a reference but forgot to update the nodes 😅 Fixed now!

@marcandre marcandre merged commit 7c0e4f6 into rubocop:master Aug 12, 2021
@marcandre
Copy link
Contributor

Released 1.10.1. Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants