rubocop-style.yml in gitlab-styles-4.3.0 vs rubocop-style.yml in gitlab-styles-5.0.0

- old
+ new

@@ -1,15 +1,26 @@ +--- +# Checks for grouping of accessors in class and module bodies. +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#styleaccessorgrouping +Style/AccessorGrouping: + Enabled: true + # Use alias_method instead of alias. Style/Alias: EnforcedStyle: prefer_alias_method Enabled: true # Whether `and` and `or` are banned only in conditionals (conditionals) # or completely (always). Style/AndOr: Enabled: true +# Enforces the use of Array() instead of explicit Array check or [*var] +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#stylearraycoercion +Style/ArrayCoercion: + Enabled: true + # Use `Array#join` instead of `Array#*`. Style/ArrayJoin: Enabled: true # Use only ascii symbols in comments. @@ -22,23 +33,33 @@ # Avoid the use of BEGIN blocks. Style/BeginBlock: Enabled: true +# Checks for places where attr_reader and attr_writer for the same method can be combined into single attr_accessor. +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#stylebisectedattraccessor +Style/BisectedAttrAccessor: + Enabled: true + # Do not use block comments. Style/BlockComments: Enabled: true # Avoid using {...} for multi-line blocks (multiline chaining is # always # ugly). Prefer {...} over do...end for single-line blocks. Style/BlockDelimiters: Enabled: true -# This cop checks for uses of the case equality operator(===). +# Checks for uses of the case equality operator(===). Style/CaseEquality: Enabled: false +# Identifies places where if-elsif constructions can be replaced with case-when. +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#stylecaselikeif +Style/CaseLikeIf: + Enabled: true + # Checks for uses of character literals. Style/CharacterLiteral: Enabled: true # Checks style of children classes and modules. @@ -93,10 +114,16 @@ # Favor the use of Fixnum#even? && Fixnum#odd? Style/EvenOdd: Enabled: true +# Enforces the use of explicit block argument to avoid writing block literal that +# just passes its arguments to another block. +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#styleexplicitblockargument +Style/ExplicitBlockArgument: + Enabled: true + # Enforces consistency when using exponential notation for numbers in the code Style/ExponentialNotation: Enabled: true # Checks use of for or each in multiline loops. @@ -109,21 +136,38 @@ # Checks if there is a magic comment to enforce string literals Style/FrozenStringLiteralComment: Enabled: true +# Enforces the use of $stdout/$stderr/$stdin instead of STDOUT/STDERR/STDIN. STDOUT/STDERR/STDIN are constants, +# and while you can actually reassign (possibly to redirect some stream) constants in Ruby, +# you’ll get an interpreter warning if you do so. +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#styleglobalstdstream +Style/GlobalStdStream: + Enabled: true + # Do not introduce global variables. Style/GlobalVars: Enabled: true Exclude: - 'lib/backup/**/*' - 'lib/tasks/**/*' +# Checks for presence or absence of braces around hash literal as a last array item depending on configuration. +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#stylehashaslastarrayitem +Style/HashAsLastArrayItem: + Enabled: true + # Checks for uses of each_key and each_value Hash methods. Style/HashEachMethods: Enabled: true +# Checks for places where case-when represents a simple 1:1 mapping and can be replaced with a hash lookup. +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#stylehashlikecase +Style/HashLikeCase: + Enabled: false + # Prefer Ruby 1.9 hash syntax `{ a: 1, b: 2 }` # over 1.8 syntax `{ :a => 1, :b => 2 }`. Style/HashSyntax: Enabled: true @@ -159,10 +203,15 @@ # Use lambda.call(...) instead of lambda.(...). Style/LambdaCall: Enabled: true +# Checks for places where keyword arguments can be used instead of boolean arguments when defining methods. +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#styleoptionalbooleanparameter +Style/OptionalBooleanParameter: + Enabled: false + # Use `strip` instead of `lstrip.rstrip`. Style/Strip: Enabled: true # Checks if the method definitions have or don't have parentheses. @@ -246,37 +295,77 @@ # Checks for %W when interpolation is not needed. Style/RedundantCapitalW: Enabled: true +# Checks for redundant assignment before returning. +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#styleredundantassignment +Style/RedundantAssignment: + Enabled: true + # Checks for an obsolete RuntimeException argument in raise/fail. Style/RedundantException: Enabled: true +# Identifies places where fetch(key) { value } can be replaced by fetch(key, value). +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#styleredundantfetchblock +Style/RedundantFetchBlock: + Enabled: true + +# 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 + # 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. Style/RedundantPercentQ: Enabled: false +# Checks for unnecessary single-element Regexp character classes. +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#styleredundantregexpcharacterclass +Style/RedundantRegexpCharacterClass: + Enabled: true + +# Checks for redundant escapes inside Regexp literals. +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#styleredundantregexpescape +Style/RedundantRegexpEscape: + Enabled: true + # Use `sort` instead of `sort_by { |x| x }`. Style/RedundantSortBy: Enabled: true # Don't use semicolons to terminate expressions. Style/Semicolon: 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 + # Checks for proper usage of fail and raise. Style/SignalException: EnforcedStyle: only_raise Enabled: true +# Checks that arrays are sliced with endless ranges instead of ary[start..-1] on Ruby 2.6+. +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#styleslicingwithrange +Style/SlicingWithRange: + Enabled: true + # Check for the usage of parentheses around stabby lambda arguments. Style/StabbyLambdaParentheses: EnforcedStyle: require_parentheses + Enabled: true + +# Checks for places where string concatenation can be replaced with string interpolation. +# https://docs.rubocop.org/rubocop/0.89/cops_style.html#stylestringconcatenation +Style/StringConcatenation: Enabled: true # Checks if uses of quotes match the configured preference. Style/StringLiterals: Enabled: false