[#7077] Cop name standardisation: Rename Unneeded*
cops to Redundant
#7460
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ofRedundant
.The affected cops are:
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'sVersionAdded
value to the presumed next release,0.76
.Within each cop, I've endeavoured to also change method names, constants, etc. from
unneeded
toredundant
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.