Merge pull request #20055 from Homebrew/cop-cask-url-verified

rubocops/cask/url: put keyword parameters on a new line
This commit is contained in:
Eric Knibbe 2025-06-05 15:32:32 +00:00 committed by GitHub
commit 0c4672a323
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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?