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

Fix offenses for InternalAffairs/OnSendWithoutOnCSend cop #76

Conversation

viralpraxis
Copy link
Collaborator

RuboCop recently added a new internal cop to detect cops which do define on_send and do not define on_csend (safe navigation).

I've fixed some cops to detect offenses in this case (where it made sense).

ref: rubocop/rubocop#13510

RuboCop recently added a new internal cop to detect cops
which do define `on_send` and do not define `on_csend`
(safe navigation).

I've fixed some cops to detect offenses in this case (where it made sense).

ref: rubocop/rubocop#13510
@viralpraxis viralpraxis self-assigned this Jan 22, 2025
@viralpraxis viralpraxis merged commit 72b8b4f into rubocop:master Jan 22, 2025
22 checks passed
@viralpraxis viralpraxis deleted the fix-internal-affairs-on-send-without-on-csend-cop branch January 22, 2025 22:35
Copy link
Collaborator

@mikegee mikegee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! ❤️

Comment on lines +50 to +51
Thread&.new { do_work }
^^^^^^^^^^^ #{msg}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this construct does not make much sense in practice. But I thought that since technically this is still an issue to detect (Thread.new is the same as Thread&.new in runtime) it's easier to just do it

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.

2 participants