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

[#7077] Cop name standardisation: Rename Unneeded* cops to Redundant #7460

Merged
merged 12 commits into from Oct 24, 2019
Merged

[#7077] Cop name standardisation: Rename Unneeded* cops to Redundant #7460

merged 12 commits into from Oct 24, 2019

Conversation

scottmatthewman
Copy link
Contributor

As mentioned in #7077, standardisation of cop names is a cleanup goal before a 1.0 release.

This PR removes the use of Unneeded in cop names, in favour of Redundant.

The affected cops are:

Previous cop name New cop name
Lint/UnneededCopDisableDirective Lint/RedundantCopDisableDirective
Lint/UnneededCopEnableDirective Lint/RedundantCopEnableDirective
Lint/UnneededRequireStatement Lint/RedundantRequireStatement
Lint/UnneededSplatExpansion Lint/RedundantSplatExpansion
Style/UnneededCapitalW Style/RedundantCapitalW
Style/UnneededCondition Style/RedundantCondition
Style/UnneededInterpolation Style/RedundantInterpolation
Style/UnneededPercentQ Style/RedundantPercentQ
Style/UnneededSort Style/RedundantSort

RuboCop's list of renamed cops (in lib/rubocop/config_obsoletion.rb) has been updated so that any settings within a user's config files will emit the appropriate message.

In terms of the settings with config/default.yml, I have gone with the precedent set in previous cop renaming commits (e.g., #6983) and set each renamed cop's VersionAdded value to the presumed next release, 0.76.

Within each cop, I've endeavoured to also change method names, constants, etc. from unneeded to redundant where such terms clearly directly relate to the cop names. For general descriptive comments or within documentation, where usage is more conversational, I've tended to keep the wording as-is.

@bbatsov bbatsov merged commit 72a5cd1 into rubocop:master Oct 24, 2019
@bbatsov
Copy link
Collaborator

bbatsov commented Oct 24, 2019

Fantastic job! 🙇 This will frustrate our users a bit, but it's a big step towards 1.0.

@Drenmi
Copy link
Collaborator

Drenmi commented Oct 25, 2019

Very nice! I have been thinking about this for a long time. 🎉

@scottmatthewman scottmatthewman deleted the rename_unneeded_cops_to_redundant branch October 27, 2019 12:29
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.

None yet

3 participants