rubocops/cask/url: put keyword parameters on a new line

This commit is contained in:
Eric Knibbe 2025-06-05 10:36:19 -04:00
parent 485f1abbee
commit c75122c694
No known key found for this signature in database

View File

@ -41,6 +41,15 @@ module RuboCop
return unless hash_node.hash_type? 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| hash_node.each_pair do |key_node, value_node|
next if key_node.source != "verified" next if key_node.source != "verified"
next unless value_node.str_type? next unless value_node.str_type?