mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
rubocops/homepage: don't attempt to auto-correct an empty string.
Fixes #10232
This commit is contained in:
parent
dad7dc6a14
commit
051fba341f
@ -90,6 +90,8 @@ module RuboCop
|
|||||||
return if node.nil?
|
return if node.nil?
|
||||||
|
|
||||||
homepage = string_content(node).dup
|
homepage = string_content(node).dup
|
||||||
|
return if homepage.nil? || homepage.empty?
|
||||||
|
|
||||||
homepage.sub!("readthedocs.org", "readthedocs.io")
|
homepage.sub!("readthedocs.org", "readthedocs.io")
|
||||||
homepage.delete_suffix!(".git") if homepage.start_with?("https://github.com")
|
homepage.delete_suffix!(".git") if homepage.start_with?("https://github.com")
|
||||||
corrector.replace(node.source_range, "\"#{homepage}\"")
|
corrector.replace(node.source_range, "\"#{homepage}\"")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user