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

Consider if any cops should be renamed #1887

Closed
bquorning opened this issue May 21, 2024 · 4 comments · Fixed by #1890
Closed

Consider if any cops should be renamed #1887

bquorning opened this issue May 21, 2024 · 4 comments · Fixed by #1890
Milestone

Comments

@bquorning
Copy link
Collaborator

Now that the next major release draws closer, I think it’s time to consider whether all of our cops are properly named.

Previous to their v1.0.0, RuboCop did a massive cop rename (see rubocop/rubocop#6983, rubocop/rubocop#7077, rubocop/rubocop#7468) and I wonder if we ever truly went over our cop names. Just one example:

  • RSpec/DuplicatedMetadata
  • RSpec/EmptyMetadata
  • RSpec/MetadataStyle
  • RSpec/SortMetadata

These four cops all check metadata, but three are named FooMetadata and one is MetadataFoo. Should one or three (or zero) be renamed?

@bquorning bquorning added this to the 3.0 milestone May 21, 2024
@bquorning
Copy link
Collaborator Author

cc @rubocop/rubocop-rspec

@pirj
Copy link
Member

pirj commented May 21, 2024

rubocop/rubocop#10725 adds some formal rules for cop naming. Even though it’s been a while, I don’t think even our new cops follow those cop naming guidelines.

I’m just thinking if this is worth the hassle for our users to rename cops in their project .rubocop.yml files? And those poor souls who dared extracting .rubocop.yml into a shared repository, while updating versions out of sync.

It is the time for this rename. But I have doubts if it is worth it. But I admin I may have a bias against renaming just because I got used to the existing naming, or I feel that the effort may be more significant than we envision it.

@bquorning
Copy link
Collaborator Author

Gotcha, you are correct that renaming might cause more pain than joy among our users. But perhaps we should copy that section from development.adoc into our repository and think a little more about cop names before adding them? 😅

@pirj
Copy link
Member

pirj commented May 22, 2024

That makes sense. I also commit to extracting the guideline part in hope to merge it

ydah added a commit that referenced this issue May 24, 2024
@ydah ydah closed this as completed in 73ccc00 May 24, 2024
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 a pull request may close this issue.

2 participants