From 97ddbb17f88057158ba067485b98319f08738e0a Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Mon, 1 Jul 2024 11:29:45 +0900 Subject: [PATCH] Use RuboCop Performance 1.21 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 ..."`. --- .rubocop.yml | 4 ++++ Gemfile | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 3df1d8f7..7fc88a4d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -117,3 +117,7 @@ Naming/FileName: Metrics/ModuleLength: Exclude: - 'test/**/*.rb' + +Performance/StringIdentifierArgument: + Exclude: + - 'test/**/*.rb' diff --git a/Gemfile b/Gemfile index 19f8772f..fe3c1bd6 100644 --- a/Gemfile +++ b/Gemfile @@ -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'