lib/rubocop/config_obsoletion.rb in rubocop-0.76.0 vs lib/rubocop/config_obsoletion.rb in rubocop-0.77.0
- old
+ new
@@ -2,26 +2,43 @@
module RuboCop
# This class handles obsolete configuration.
class ConfigObsoletion
RENAMED_COPS = {
+ 'Layout/AlignArguments' => 'Layout/ArgumentAlignment',
+ 'Layout/AlignArray' => 'Layout/ArrayAlignment',
+ 'Layout/AlignHash' => 'Layout/HashAlignment',
+ 'Layout/AlignParameters' => 'Layout/ParameterAlignment',
+ 'Layout/IndentArray' => 'Layout/FirstArrayElementIndentation',
+ 'Layout/IndentAssignment' => 'Layout/AssignmentIndentation',
+ 'Layout/IndentFirstArgument' => 'Layout/FirstArgumentIndentation',
+ 'Layout/IndentFirstArrayElement' => 'Layout/FirstArrayElementIndentation',
+ 'Layout/IndentFirstHashElement' => 'Layout/FirstHashElementIndentation',
+ 'Layout/IndentFirstParameter' => 'Layout/FirstParameterIndentation',
+ 'Layout/IndentHash' => 'Layout/FirstHashElementIndentation',
+ 'Layout/IndentHeredoc' => 'Layout/HeredocIndentation',
+ 'Layout/LeadingBlankLines' => 'Layout/LeadingEmptyLines',
+ 'Layout/TrailingBlankLines' => 'Layout/TrailingEmptyLines',
+ 'Lint/DuplicatedKey' => 'Lint/DuplicateHashKey',
+ 'Lint/HandleExceptions' => 'Lint/SuppressedException',
+ 'Lint/MultipleCompare' => 'Lint/MultipleComparison',
+ 'Lint/StringConversionInInterpolation' => 'Lint/RedundantStringCoercion',
'Lint/UnneededCopDisableDirective' => 'Lint/RedundantCopDisableDirective',
'Lint/UnneededCopEnableDirective' => 'Lint/RedundantCopEnableDirective',
'Lint/UnneededRequireStatement' => 'Lint/RedundantRequireStatement',
'Lint/UnneededSplatExpansion' => 'Lint/RedundantSplatExpansion',
- 'Style/SingleSpaceBeforeFirstArg' => 'Layout/SpaceBeforeFirstArg',
- 'Style/MethodCallParentheses' => 'Style/MethodCallWithoutArgsParentheses',
+ 'Naming/UncommunicativeBlockParamName' => 'Naming/BlockParameterName',
+ 'Naming/UncommunicativeMethodParamName' => 'Naming/MethodParameterName',
'Style/DeprecatedHashMethods' => 'Style/PreferredHashMethods',
+ 'Style/MethodCallParentheses' => 'Style/MethodCallWithoutArgsParentheses',
'Style/OpMethod' => 'Naming/BinaryOperatorParameterName',
+ 'Style/SingleSpaceBeforeFirstArg' => 'Layout/SpaceBeforeFirstArg',
'Style/UnneededCapitalW' => 'Style/RedundantCapitalW',
'Style/UnneededCondition' => 'Style/RedundantCondition',
'Style/UnneededInterpolation' => 'Style/RedundantInterpolation',
'Style/UnneededPercentQ' => 'Style/RedundantPercentQ',
- 'Style/UnneededSort' => 'Style/RedundantSort',
- 'Layout/FirstParameterIndentation' => 'Layout/IndentFirstArgument',
- 'Layout/IndentArray' => 'Layout/IndentFirstArrayElement',
- 'Layout/IndentHash' => 'Layout/IndentFirstHashElement'
+ 'Style/UnneededSort' => 'Style/RedundantSort'
}.map do |old_name, new_name|
[old_name, "The `#{old_name}` cop has been renamed to `#{new_name}`."]
end
MOVED_COPS = {
@@ -39,22 +56,22 @@
"`#{new_department}/#{old_name.split('/').last}`."]
end
end
REMOVED_COPS = {
- 'Rails/DefaultScope' => nil,
'Layout/SpaceAfterControlKeyword' => 'Layout/SpaceAroundKeyword',
'Layout/SpaceBeforeModifierKeyword' => 'Layout/SpaceAroundKeyword',
+ 'Lint/RescueWithoutErrorClass' => 'Style/RescueStandardError',
+ 'Rails/DefaultScope' => nil,
'Style/SpaceAfterControlKeyword' => 'Layout/SpaceAroundKeyword',
'Style/SpaceBeforeModifierKeyword' => 'Layout/SpaceAroundKeyword',
'Style/TrailingComma' => 'Style/TrailingCommaInArguments, ' \
'Style/TrailingCommaInArrayLiteral, and/or ' \
'Style/TrailingCommaInHashLiteral',
'Style/TrailingCommaInLiteral' => 'Style/TrailingCommaInArrayLiteral ' \
'and/or ' \
- 'Style/TrailingCommaInHashLiteral',
- 'Lint/RescueWithoutErrorClass' => 'Style/RescueStandardError'
+ 'Style/TrailingCommaInHashLiteral'
}.map do |old_name, other_cops|
if other_cops
more = ". Please use #{other_cops} instead".gsub(%r{[A-Z]\w+/\w+},
'`\&`')
end
@@ -138,9 +155,45 @@
{
cops: %w[Performance/Count Performance/Detect],
parameters: 'SafeMode',
alternative: '`SafeMode` has been removed. ' \
'Use `SafeAutoCorrect` instead.'
+ },
+ {
+ cops: 'Bundler/GemComment',
+ parameters: 'Whitelist',
+ alternative: '`Whitelist` has been renamed to `IgnoredGems`.'
+ },
+ {
+ cops: %w[
+ Lint/SafeNavigationChain Lint/SafeNavigationConsistency
+ Style/NestedParenthesizedCalls Style/SafeNavigation
+ Style/TrivialAccessors
+ ],
+ parameters: 'Whitelist',
+ alternative: '`Whitelist` has been renamed to `AllowedMethods`.'
+ },
+ {
+ cops: 'Style/IpAddresses',
+ parameters: 'Whitelist',
+ alternative: '`Whitelist` has been renamed to `AllowedAddresses`.'
+ },
+ {
+ cops: 'Naming/HeredocDelimiterNaming',
+ parameters: 'Blacklist',
+ alternative: '`Blacklist` has been renamed to `ForbiddenDelimiters`.'
+ },
+ {
+ cops: 'Naming/PredicateName',
+ parameters: 'NamePrefixBlacklist',
+ alternative: '`NamePrefixBlacklist` has been renamed to ' \
+ '`ForbiddenPrefixes`.'
+ },
+ {
+ cops: 'Naming/PredicateName',
+ parameters: 'NameWhitelist',
+ alternative: '`NameWhitelist` has been renamed to ' \
+ '`AllowedMethods`.'
}
].freeze
OBSOLETE_ENFORCED_STYLES = [
{