From 79b4b94f3a3ec0ee7d81acf152e66b802e250b39 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 7 Feb 2024 09:54:40 -0500 Subject: [PATCH] Configure `CountAsOne` value for `RSpec/ExampleLength` cop (#29115) --- .rubocop.yml | 5 +++++ .rubocop_todo.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 330c40de1b..a8310489ea 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -134,6 +134,11 @@ Rails/UnusedIgnoredColumns: Rails/NegateInclude: Enabled: false +# Reason: Enforce default limit, but allow some elements to span lines +# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecexamplelength +RSpec/ExampleLength: + CountAsOne: ['array', 'heredoc', 'method_call'] + # Reason: Deprecated cop, will be removed in 3.0, replaced by SpecFilePathFormat # https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecfilepath RSpec/FilePath: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 09e9fd73d8..11ac570836 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -36,7 +36,7 @@ Metrics/PerceivedComplexity: # Configuration parameters: CountAsOne. RSpec/ExampleLength: - Max: 22 + Max: 20 # Override default of 5 RSpec/MultipleExpectations: Max: 7