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
Support csend
on Style/SymbolProc
#10810
Support csend
on Style/SymbolProc
#10810
Conversation
Nice catch! Thanks! |
@@ -0,0 +1 @@ | |||
* [#10810](https://github.com/rubocop/rubocop/pull/10810): Support `csend` on `Style/SymbolProc`. ([@r7kamura][]) |
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.
* [#10810](https://github.com/rubocop/rubocop/pull/10810): Support `csend` on `Style/SymbolProc`. ([@r7kamura][]) | |
* [#10810](https://github.com/rubocop/rubocop/pull/10810): Support safe navigation operator on `Style/SymbolProc`. ([@r7kamura][]) |
@@ -81,7 +81,7 @@ class SymbolProc < Base | |||
def_node_matcher :proc_node?, '(send (const {nil? cbase} :Proc) :new)' | |||
|
|||
# @!method symbol_proc_receiver?(node) | |||
def_node_matcher :symbol_proc_receiver?, '{(send ...) (super ...) zsuper}' | |||
def_node_matcher :symbol_proc_receiver?, '{({csend | send} ...) (super ...) zsuper}' |
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.
def_node_matcher :symbol_proc_receiver?, '{({csend | send} ...) (super ...) zsuper}' | |
def_node_matcher :symbol_proc_receiver?, '{(call ...) (super ...) zsuper}' |
@@ -12,6 +12,17 @@ | |||
RUBY | |||
end | |||
|
|||
it 'registers an offense for csend' do |
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.
it 'registers an offense for csend' do | |
it 'registers an offense for safe navigation operator' do |
The comments were delayed, please never mind. |
Improve `Style/SymbolProc` about #10810 changes
I think the following bad side code should also be treated as an offense:
Before submitting the PR make sure the following are checked:
Commit message starts with[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.