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

Update .rubocop.yml, and disable OnSendWithoutOnCSend #2026

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

bquorning
Copy link
Collaborator

A new cop InternalAffairs/OnSendWithoutOnCSend was added to RuboCop in rubocop/rubocop#13719.

cc @dvandersluis

@pirj
Copy link
Member

pirj commented Jan 28, 2025

My internal parser broke on arg?.(1). What is a csend?

@dvandersluis
Copy link
Member

dvandersluis commented Jan 28, 2025

csend is safe navigation (foo&.bar).

I haven't looked through all the cops in here but it might be that the OnSendWithoutOnCSend cop just doesn't make sense for rubocop-rspec and could be wholesale disabled. I don't think there's a lot of instances where safe navigation would be used in tests, and anywhere that you're calling a method on a constant or as a macro doesn't really need safe navigation support.

bquorning added a commit that referenced this pull request Feb 5, 2025
We keep InternalAffairs/OnSendWithoutOnCSend disabled, with the
following reasoning (almost verbatim quoted from @dvandersluis[^1]):

> Maybe the OnSendWithoutOnCSend cop doesn't make sense for
> rubocop-rspec. There are not a lot of instances where safe navigation
> would be used in tests, and anywhere that we're calling a method on a
> constant or as a macro doesn't really need safe navigation support.

[^1]: #2026 (comment)
@bquorning bquorning force-pushed the regenerate-todo-file branch from 81f492d to 9eb77cd Compare February 5, 2025 22:51
@bquorning bquorning changed the title Regenerate RuboCop TODO file with latest RuboCop version Update .rubocop.yml, and disable OnSendWithoutOnCSend Feb 5, 2025
@bquorning
Copy link
Collaborator Author

I decided to follow @dvandersluis’ advice and outright disable the OnSendWithoutOnCSend cop.

I have update the PR to also include enabling of all pending cops up until the latest version.

The oldest version of RuboCop may not be able to read our configuration
file. That doesn't matter, we just need the version number, and
assurance that the specs can run.
We keep InternalAffairs/OnSendWithoutOnCSend disabled, with the
following reasoning (almost verbatim quoted from @dvandersluis[^1]):

> Maybe the OnSendWithoutOnCSend cop doesn't make sense for
> rubocop-rspec. There are not a lot of instances where safe navigation
> would be used in tests, and anywhere that we're calling a method on a
> constant or as a macro doesn't really need safe navigation support.

[^1]: #2026 (comment)
@bquorning bquorning force-pushed the regenerate-todo-file branch from 9eb77cd to 3210f7d Compare February 5, 2025 23:04
@bquorning bquorning merged commit e223436 into master Feb 5, 2025
27 checks passed
@bquorning bquorning deleted the regenerate-todo-file branch February 5, 2025 23:06
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.

4 participants