From fed1bbe0296240093f0827642b5f0f51b01a1a2b Mon Sep 17 00:00:00 2001 From: Issy Long Date: Sun, 13 Oct 2019 10:19:15 +0100 Subject: [PATCH] Disable Metrics/LineLength for long URL lines in patches_spec.rb - The final two `brew style` offenses were for Metrics/LineLength where parsing the GitHub diff URL as a regex took 119/118 lines. - This disables the cop for each of those long, problematic lines, and re-enables them straight afterwards, else they'd apply to the whole file from the first occurrence onwards, which we probably don't want? - I wondered about increasing the LineLength limit to 119 or 120, but it appears to have been set for a justifiable reason in 80d75bc0d8. --- Library/Homebrew/test/rubocops/patches_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/test/rubocops/patches_spec.rb b/Library/Homebrew/test/rubocops/patches_spec.rb index 9e8826ce1d..0191e03f07 100644 --- a/Library/Homebrew/test/rubocops/patches_spec.rb +++ b/Library/Homebrew/test/rubocops/patches_spec.rb @@ -88,7 +88,9 @@ describe RuboCop::Cop::FormulaAudit::Patches do line: 5, column: 5, source: source }] + # rubocop:disable Metrics/LineLength elsif %r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)}.match?(patch_url) + # rubocop:enable Metrics/LineLength [{ message: <<~EOS, use GitHub pull request URLs: @@ -223,7 +225,9 @@ describe RuboCop::Cop::FormulaAudit::Patches do line: 5, column: 9, source: source }] + # rubocop:disable Metrics/LineLength elsif %r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)}.match?(patch_url) + # rubocop:enable Metrics/LineLength [{ message: <<~EOS, use GitHub pull request URLs: