Skip to content

Commit

Permalink
rubocop: Add more Performance/* checks
Browse files Browse the repository at this point in the history
See: #42
  • Loading branch information
ribose-jeffreylau committed Nov 9, 2023
1 parent e2bff59 commit d2d05a8
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
28 changes: 28 additions & 0 deletions ci/rubocop.rails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,34 @@ Metrics/PerceivedComplexity:
reader.
Enabled: true
Max: 7
Performance/AncestorsInclude:
Enabled: true
Performance/BigDecimalWithNumericArgument:
Enabled: true
Performance/BlockGivenWithExplicitBlock:
Enabled: true
Performance/CollectionLiteralInLoop:
Enabled: true
Performance/MethodObjectAsBlock:
Enabled: true
Performance/RedundantEqualityComparisonBlock:
Enabled: true
Performance/RedundantSortBlock:
Enabled: true
Performance/RedundantSplitRegexpArgument:
Enabled: true
Performance/RedundantStringChars:
Enabled: true
Performance/ReverseFirst:
Enabled: true
Performance/SortReverse:
Enabled: true
Performance/Squeeze:
Enabled: true
Performance/StringInclude:
Enabled: true
Performance/Sum:
Enabled: true
Style/CollectionCompact:
Description: Checks for places where custom logic on rejection nils from arrays
and hashes can be replaced with {Array,Hash}#{compact,compact!}.
Expand Down
28 changes: 28 additions & 0 deletions ci/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,34 @@ Metrics/PerceivedComplexity:
reader.
Enabled: true
Max: 7
Performance/AncestorsInclude:
Enabled: true
Performance/BigDecimalWithNumericArgument:
Enabled: true
Performance/BlockGivenWithExplicitBlock:
Enabled: true
Performance/CollectionLiteralInLoop:
Enabled: true
Performance/MethodObjectAsBlock:
Enabled: true
Performance/RedundantEqualityComparisonBlock:
Enabled: true
Performance/RedundantSortBlock:
Enabled: true
Performance/RedundantSplitRegexpArgument:
Enabled: true
Performance/RedundantStringChars:
Enabled: true
Performance/ReverseFirst:
Enabled: true
Performance/SortReverse:
Enabled: true
Performance/Squeeze:
Enabled: true
Performance/StringInclude:
Enabled: true
Performance/Sum:
Enabled: true
Style/CollectionCompact:
Description: Checks for places where custom logic on rejection nils from arrays
and hashes can be replaced with {Array,Hash}#{compact,compact!}.
Expand Down
45 changes: 45 additions & 0 deletions src/rubocop/rubocop.ribose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,51 @@ Metrics/PerceivedComplexity:
Enabled: true
Max: 7

Performance/AncestorsInclude: # (new in 1.7)
Enabled: true

Performance/BigDecimalWithNumericArgument: # (new in 1.7)
Enabled: true

Performance/BlockGivenWithExplicitBlock: # (new in 1.9)
Enabled: true

Performance/CollectionLiteralInLoop: # (new in 1.8)
Enabled: true

Performance/ConstantRegexp: # (new in 1.9)
Enabled: true

Performance/MethodObjectAsBlock: # (new in 1.9)
Enabled: true

Performance/RedundantEqualityComparisonBlock: # (new in 1.10)
Enabled: true

Performance/RedundantSortBlock: # (new in 1.7)
Enabled: true

Performance/RedundantSplitRegexpArgument: # (new in 1.10)
Enabled: true

Performance/RedundantStringChars: # (new in 1.7)
Enabled: true

Performance/ReverseFirst: # (new in 1.7)
Enabled: true

Performance/SortReverse: # (new in 1.7)
Enabled: true

Performance/Squeeze: # (new in 1.7)
Enabled: true

Performance/StringInclude: # (new in 1.7)
Enabled: true

Performance/Sum: # (new in 1.8)
Enabled: true

Style/CollectionCompact:
Description: Checks for places where custom logic on rejection nils from arrays and hashes can be replaced with {Array,Hash}#{compact,compact!}.
StyleGuide: https://docs.rubocop.org/rubocop/cops_style.html#stylecollectioncompact
Expand Down

0 comments on commit d2d05a8

Please sign in to comment.