rubocop-style.yml in gitlab-styles-11.0.0 vs rubocop-style.yml in gitlab-styles-13.0.0

- old
+ new

@@ -180,12 +180,15 @@ Style/HashLikeCase: Enabled: false # Prefer Ruby 1.9 hash syntax `{ a: 1, b: 2 }` # over 1.8 syntax `{ :a => 1, :b => 2 }`. +# Short-hand Hash syntax does not work prior 3.1. +# See https://gitlab.com/gitlab-org/gitlab/-/issues/435940#note_1703307479 Style/HashSyntax: Enabled: true + EnforcedShorthandSyntax: never # looks for uses of _.each_with_object({}) {...}, _.map {...}.to_h, and Hash[_.map {...}] # that are actually just transforming the keys of a hash, and tries to use a simpler & faster # call to transform_keys instead. Style/HashTransformKeys: @@ -220,10 +223,14 @@ # Use the inverse method instead of `!.method` # if an inverse method is defined. Style/InverseMethods: Enabled: false +# Use iso8601 date format via specific function instead of strftime +Style/Iso8601Date: + Enabled: true + Style/KeywordParametersOrder: # (new in 0.90) Enabled: true # Use lambda.call(...) instead of lambda.(...). Style/LambdaCall: @@ -236,10 +243,14 @@ # Use `strip` instead of `lstrip.rstrip`. Style/Strip: Enabled: true +# Checks for usages of each with <<, push, or append which can be replaced by map. +Style/MapIntoArray: + Enabled: true + # Checks if the method definitions have or don't have parentheses. Style/MethodDefParentheses: Enabled: true # Checks for usage of `extend self` in modules. @@ -358,10 +369,16 @@ # Checks for the presence of superfluous .rb extension in the filename provided to require and require_relative. # https://docs.rubocop.org/rubocop/0.89/cops_style.html#styleredundantfileextensioninrequire Style/RedundantFileExtensionInRequire: Enabled: true +# Before Ruby 3.0, interpolated strings followed the frozen string literal magic comment which sometimes made it +# necessary to explicitly unfreeze them. Ruby 3.0 changed interpolated strings to always be unfrozen which makes +# unfreezing them redundant. +Style/RedundantInterpolationUnfreeze: + Enabled: true + # Checks for parentheses that seem not to serve any purpose. Style/RedundantParentheses: Enabled: true # Checks for %q/%Q when single quotes or double quotes would do. @@ -387,10 +404,14 @@ # Don't use semicolons to terminate expressions. Style/Semicolon: Enabled: true +# Detects the use of the public_send method with a literal method name argument. +Style/SendWithLiteralMethodName: + Enabled: true + # Sometimes using dig method ends up with just a single argument. In such cases, dig should be replaced with []. # https://docs.rubocop.org/rubocop/0.89/cops_style.html#stylesingleargumentdig Style/SingleArgumentDig: Enabled: true @@ -423,9 +444,14 @@ # Checks if configured preferred methods are used over non-preferred. Style/StringMethods: PreferredMethods: intern: to_sym + Enabled: true + +# Checks for redundant argument forwarding when calling super with arguments identical to +# the method definition. +Style/SuperArguments: Enabled: true # Use %i or %I for arrays of symbols. Style/SymbolArray: Enabled: false