From c75122c694c07cf55526ec1a4f0fd265b414b913 Mon Sep 17 00:00:00 2001 From: Eric Knibbe Date: Thu, 5 Jun 2025 10:36:19 -0400 Subject: [PATCH] rubocops/cask/url: put keyword parameters on a new line --- Library/Homebrew/rubocops/cask/url.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Library/Homebrew/rubocops/cask/url.rb b/Library/Homebrew/rubocops/cask/url.rb index a62f5e884a..54ffcd1e84 100644 --- a/Library/Homebrew/rubocops/cask/url.rb +++ b/Library/Homebrew/rubocops/cask/url.rb @@ -41,6 +41,15 @@ module RuboCop return unless hash_node.hash_type? + unless stanza_node.source.match?(/",\n *\w+:/) + add_offense( + stanza_node.source_range, + message: "Keyword URL parameter should be on a new indented line.", + ) do |corrector| + corrector.replace(stanza_node.source_range, stanza_node.source.gsub(/",\s*/, "\",\n ")) + end + end + hash_node.each_pair do |key_node, value_node| next if key_node.source != "verified" next unless value_node.str_type?