Merge pull request #11169 from issyl0/fix-patch-url-autocorrection
rubocops/patches: Fix quoting of the patch `url` when autocorrecting
This commit is contained in:
commit
5c352437d9
@ -69,7 +69,7 @@ module RuboCop
|
|||||||
gh_patch_param_pattern = %r{https?://github\.com/.+/.+/(?:commit|pull)/[a-fA-F0-9]*.(?:patch|diff)}
|
gh_patch_param_pattern = %r{https?://github\.com/.+/.+/(?:commit|pull)/[a-fA-F0-9]*.(?:patch|diff)}
|
||||||
if regex_match_group(patch_url_node, gh_patch_param_pattern) && !patch_url.match?(/\?full_index=\w+$/)
|
if regex_match_group(patch_url_node, gh_patch_param_pattern) && !patch_url.match?(/\?full_index=\w+$/)
|
||||||
problem "GitHub patches should use the full_index parameter: #{patch_url}?full_index=1" do |corrector|
|
problem "GitHub patches should use the full_index parameter: #{patch_url}?full_index=1" do |corrector|
|
||||||
corrector.replace(patch_url_node.source_range, "#{patch_url}?full_index=1")
|
corrector.replace(patch_url_node.source_range, "\"#{patch_url}?full_index=1\"")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user