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

- old
+ new

@@ -1,5 +1,17 @@ +--- +# Used to identify usages of ancestors.include? and change them to use ⇐ instead. +# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performanceancestorsinclude +Performance/AncestorsInclude: + Enabled: true + +# Identifies places where numeric argument to BigDecimal should be converted to string. +# Initializing from String is faster than from Numeric for BigDecimal. +# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performancebigdecimalwithnumericargument +Performance/BigDecimalWithNumericArgument: + Enabled: true + # Use `caller(n..n)` instead of `caller`. Performance/Caller: Enabled: false # Use `casecmp` rather than `downcase ==`. @@ -29,18 +41,54 @@ # `Hash#[]=`. Performance/RedundantMerge: Enabled: true MaxKeyValuePairs: 1 +# Identifies places where sort { |a, b| a <=> b } can be replaced with sort. +# https://docs.rubocop.org/rubocop-performance/1.7/cops_performance.html#performanceredundantsortblock +Performance/RedundantSortBlock: + Enabled: true + +# Checks for redundant String#chars. +# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performanceredundantstringchars +Performance/RedundantStringChars: + Enabled: true + +# Identifies places where reverse.first(n) and reverse.first can be replaced by last(n).reverse and last. +# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performancereversefirst +Performance/ReverseFirst: + Enabled: true + +# Identifies places where sort { |a, b| b <=> a } can be replaced by a faster sort.reverse. +# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performancesortreverse +Performance/SortReverse: + Enabled: true + +# Identifies places where gsub(/a+/, 'a') and gsub!(/a+/, 'a') can be replaced by squeeze('a') and squeeze!('a'). +# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performancesqueeze +Performance/Squeeze: + Enabled: true + # Use `start_with?` instead of a regex match anchored to the beginning of a # string. Performance/StartWith: Enabled: true +# Identifies unnecessary use of a regex where String#include? would suffice. +# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performancestringinclude +Performance/StringInclude: + Enabled: true + # Use `tr` instead of `gsub` when you are replacing the same number of # characters. Use `delete` instead of `gsub` when you are deleting # characters. Performance/StringReplacement: + Enabled: true + +# Identifies places where custom code finding the sum of elements in some +# Enumerable object can be replaced by Enumerable#sum method. +# https://docs.rubocop.org/rubocop-performance/1.8/cops_performance.html#performancesum +Performance/Sum: Enabled: true # Checks for `.times.map` calls. Performance/TimesMap: Enabled: true