-
-
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
Leverage more node extensions #6954
Leverage more node extensions #6954
Conversation
Great work! 🙇 |
Follow up rubocop/rubocop#6954. This PR applies `rubocop --auto-gen-config`.
Follow up rubocop/rubocop#6954. This PR applied `rubocop --auto-gen-config`.
@Drenmi I'm trying to make some custom cops comply with this new rule, but I'm not familiar with node extensions. I don't see anything about it on the README or the wiki. Same examples:
Based on the message I see from Rubocop, I tried changing to this shape:
But I get errors like this:
Could you please advise? |
@bbuchalter You can find documentation for the node extension decorators in RubyDoc. For example, if you have a If you have a Etc. Note that we don't have node extensions for all node types yet, but I'm working on it. |
Follow up rubocop/rubocop#6954. This PR applied `rubocop --auto-gen-config`.
Follow up rubocop/rubocop#6954. This PR applied `rubocop --auto-gen-config`.
Follow up rubocop/rubocop#6954. This PR applied `rubocop --auto-gen-config`.
Follow up rubocop/rubocop#6954. This PR applied `rubocop --auto-gen-config`.
This change makes our
InternalAffairs/NodeDestructuring
a bit more picky. Before, it accepted splat destructuring, e.g.:but with this change, it enforces the use of node extension methods for all use cases.
I hope to use this to guide me in adding more node extensions.
This change already comes with a slew of fixes where existing node extensions could be used in place of splat destructuring.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).and description in grammatically correct, complete sentences.
bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.