Skip to content

Commit

Permalink
Use RuboCop Performance 1.21
Browse files Browse the repository at this point in the history
This commit disables `Performance/StringIdentifierArgument` under the `test/**` directory
to suppress the following detection:

```console
test/rubocop/cop/minitest/assert_match_test.rb:7:19: C: [Correctable] Performance/StringIdentifierArgument:
Use :"test_registers_offense_when_using_assert_with_#{matcher}" instead of "test_registers_offense_when_using_assert_with_#{matcher}".
    define_method("test_registers_offense_when_using_assert_with_#{matcher}") do
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

This setting is because the code in this directory is test code, and performance is not of utmost importance.
Additionally, `:"Use ..."` is not necessarily more readable than `"Use ..."`.
  • Loading branch information
koic committed Jul 1, 2024
1 parent 654e0e6 commit 97ddbb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,7 @@ Naming/FileName:
Metrics/ModuleLength:
Exclude:
- 'test/**/*.rb'

Performance/StringIdentifierArgument:
Exclude:
- 'test/**/*.rb'
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gem 'minitest-proveit'
gem 'prism'
gem 'rake'
gem 'rubocop', github: 'rubocop/rubocop'
gem 'rubocop-performance', '~> 1.18.0'
gem 'rubocop-performance', '~> 1.21.0'
gem 'test-queue'
gem 'yard', '~> 0.9'

Expand Down

0 comments on commit 97ddbb1

Please sign in to comment.