Skip to content

Commit

Permalink
Add RuboCop Performance
Browse files Browse the repository at this point in the history
  • Loading branch information
tagliala committed Oct 24, 2023
1 parent 70ed0b9 commit 2b6b10e
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 1 deletion.
159 changes: 158 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---

require: rubocop-packaging
require:
- rubocop-packaging
- rubocop-performance

AllCops:
DisabledByDefault: true
Expand All @@ -25,6 +27,161 @@ Layout/TrailingEmptyLines:
Layout/TrailingWhitespace:
Enabled: true

Performance/AncestorsInclude:
Enabled: false

Performance/ArraySemiInfiniteRangeSlice:
Enabled: false

Performance/BigDecimalWithNumericArgument:
Enabled: true

Performance/BindCall:
Enabled: true

Performance/BlockGivenWithExplicitBlock:
Enabled: true

Performance/Caller:
Enabled: true

Performance/CaseWhenSplat:
Enabled: true

Performance/Casecmp:
Enabled: false

Performance/ChainArrayAllocation:
Enabled: false

Performance/CollectionLiteralInLoop:
Enabled: true
Exclude:
- spec/**/*

Performance/CompareWithBlock:
Enabled: true

Performance/ConcurrentMonotonicTime:
Enabled: true

Performance/ConstantRegexp:
Enabled: true

Performance/Count:
Enabled: true

Performance/DeletePrefix:
Enabled: true

Performance/DeleteSuffix:
Enabled: true

Performance/Detect:
Enabled: true

Performance/DoubleStartEndWith:
Enabled: true
IncludeActiveSupportAliases: true

Performance/EndWith:
Enabled: true

Performance/FixedSize:
Enabled: true

Performance/FlatMap:
Enabled: true
EnabledForFlattenWithoutParams: false

Performance/InefficientHashSearch:
Enabled: true

Performance/IoReadlines:
Enabled: true

Performance/MapCompact:
Enabled: false

Performance/MapMethodChain:
Enabled: false

Performance/MethodObjectAsBlock:
Enabled: true

Performance/OpenStruct:
Enabled: true

Performance/RangeInclude:
Enabled: true

Performance/RedundantBlockCall:
Enabled: false

Performance/RedundantEqualityComparisonBlock:
Enabled: false

Performance/RedundantMatch:
Enabled: true

Performance/RedundantMerge:
Enabled: true
MaxKeyValuePairs: 2

Performance/RedundantSortBlock:
Enabled: true

Performance/RedundantSplitRegexpArgument:
Enabled: true

Performance/RedundantStringChars:
Enabled: true

Performance/RegexpMatch:
Enabled: true

Performance/ReverseEach:
Enabled: true

Performance/ReverseFirst:
Enabled: true

Performance/SelectMap:
Enabled: false

Performance/Size:
Enabled: true

Performance/SortReverse:
Enabled: true

Performance/Squeeze:
Enabled: true

Performance/StartWith:
Enabled: true

Performance/StringIdentifierArgument:
Enabled: true

Performance/StringInclude:
Enabled: true

Performance/StringReplacement:
Enabled: true

Performance/Sum:
Enabled: false

Performance/TimesMap:
Enabled: true

Performance/UnfreezeString:
Enabled: true

Performance/UriDefaultParser:
Enabled: true

Style/FrozenStringLiteralComment:
Enabled: true
Exclude:
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ end
group :rubocop do
gem 'rubocop'
gem 'rubocop-packaging'
gem 'rubocop-performance'
end

group :rails do
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ GEM
parser (>= 3.2.1.0)
rubocop-packaging (0.5.2)
rubocop (>= 1.33, < 2.0)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
simplecov (0.22.0)
Expand Down Expand Up @@ -301,6 +304,7 @@ DEPENDENCIES
rspec-rails
rubocop
rubocop-packaging
rubocop-performance
simplecov
simplecov-cobertura

Expand Down
1 change: 1 addition & 0 deletions gemfiles/rails_61/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ end
group :rubocop do
gem 'rubocop'
gem 'rubocop-packaging'
gem 'rubocop-performance'
end

group :rails do
Expand Down
4 changes: 4 additions & 0 deletions gemfiles/rails_61/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ GEM
parser (>= 3.2.1.0)
rubocop-packaging (0.5.2)
rubocop (>= 1.33, < 2.0)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
simplecov (0.22.0)
Expand Down Expand Up @@ -266,6 +269,7 @@ DEPENDENCIES
rspec-rails
rubocop
rubocop-packaging
rubocop-performance
simplecov
simplecov-cobertura

Expand Down
1 change: 1 addition & 0 deletions gemfiles/rails_70/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ end
group :rubocop do
gem 'rubocop'
gem 'rubocop-packaging'
gem 'rubocop-performance'
end

group :rails do
Expand Down
4 changes: 4 additions & 0 deletions gemfiles/rails_70/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ GEM
parser (>= 3.2.1.0)
rubocop-packaging (0.5.2)
rubocop (>= 1.33, < 2.0)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
simplecov (0.22.0)
Expand Down Expand Up @@ -265,6 +268,7 @@ DEPENDENCIES
rspec-rails
rubocop
rubocop-packaging
rubocop-performance
simplecov
simplecov-cobertura

Expand Down

0 comments on commit 2b6b10e

Please sign in to comment.