From 1023d57f1284ad5b11483600bdd504638a3a9e06 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Wed, 8 Feb 2023 19:53:21 -0500 Subject: [PATCH] Allow `def test_...` lines to be long We currently allow lines like test "a really really ... really long test name" do using the Active Support declarative test style to violate `Layout/LineLength`. It stands to reason we should also allow the equivalent Minitest style def test_a_really_really_..._really_long_test_name --- rubocop.yml | 1 + test/fixtures/full_config.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/rubocop.yml b/rubocop.yml index d3d6f2c2..002a592a 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -66,6 +66,7 @@ Layout/LineEndStringConcatenationIndentation: Layout/LineLength: AllowedPatterns: - "\\A\\s*(remote_)?test(_\\w+)?\\s.*(do|->)(\\s|\\Z)" + - "\\A\\s*def test_\\w+\\s*\\Z" Layout/MultilineArrayLineBreaks: Enabled: true diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 8e222f0c..fc4690c0 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -717,6 +717,7 @@ Layout/LineLength: IgnoreCopDirectives: true AllowedPatterns: - "\\A\\s*(remote_)?test(_\\w+)?\\s.*(do|->)(\\s|\\Z)" + - "\\A\\s*def test_\\w+\\s*\\Z" IgnoredPatterns: [] Layout/MultilineArrayBraceLayout: Description: Checks that the closing brace in an array literal is either on the