Skip to content

Commit

Permalink
Enable cop for pending rubocop-performance
Browse files Browse the repository at this point in the history
```
❯ bundle exec rubocop
Inspecting 42 files
.......................................C..

Offenses:

spec/spec_helper.rb:17:9: C: Performance/MethodObjectAsBlock: Use block explicitly instead of block-passing a method object.
  .each(&method(:require))
        ^^^^^^^^^^^^^^^^^

42 files inspected, 1 offense detected
```
  • Loading branch information
ydah committed Feb 15, 2024
1 parent 8c1e9ae commit db926f8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,43 @@ Style/RedundantStringEscape:
Style/ReturnNilInPredicateMethodDefinition:
Enabled: true

# Enable pending rubocop-performance cops.

Performance/AncestorsInclude:
Enabled: true
Performance/BlockGivenWithExplicitBlock:
Enabled: true
Performance/CollectionLiteralInLoop:
Enabled: true
Performance/ConstantRegexp:
Enabled: true
Performance/MapCompact:
Enabled: true
Performance/MapMethodChain:
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/StringIdentifierArgument:
Enabled: true
Performance/StringInclude:
Enabled: true
Performance/Sum:
Enabled: true

# Enable pending rubocop-rspec cops.

RSpec/BeEmpty:
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module SpecHelper
Dir
.glob(File.expand_path(spec_helper_glob, __dir__))
.sort
.each(&method(:require))
.each { |file| require file }

RSpec.configure do |config|
# Set metadata so smoke tests are run on all cop specs
Expand Down

0 comments on commit db926f8

Please sign in to comment.