Skip to content

Commit 0c4672a

Browse files
Merge pull request #20055 from Homebrew/cop-cask-url-verified
rubocops/cask/url: put keyword parameters on a new line
2 parents 1d2f045 + c75122c commit 0c4672a

File tree

1 file changed

+9
-0
lines changed
  • Library/Homebrew/rubocops/cask

1 file changed

+9
-0
lines changed

Library/Homebrew/rubocops/cask/url.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ def on_url_stanza(stanza)
4141

4242
return unless hash_node.hash_type?
4343

44+
unless stanza_node.source.match?(/",\n *\w+:/)
45+
add_offense(
46+
stanza_node.source_range,
47+
message: "Keyword URL parameter should be on a new indented line.",
48+
) do |corrector|
49+
corrector.replace(stanza_node.source_range, stanza_node.source.gsub(/",\s*/, "\",\n "))
50+
end
51+
end
52+
4453
hash_node.each_pair do |key_node, value_node|
4554
next if key_node.source != "verified"
4655
next unless value_node.str_type?

0 commit comments

Comments
 (0)