Merge pull request #10237 from MikeMcQuaid/homepage-blank-corrector-fix

rubocops/homepage: don't attempt to auto-correct an empty string.
This commit is contained in:
Mike McQuaid 2021-01-07 09:51:30 +00:00 committed by GitHub
commit 2592e406bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,6 +90,8 @@ module RuboCop
return if node.nil?
homepage = string_content(node).dup
return if homepage.nil? || homepage.empty?
homepage.sub!("readthedocs.org", "readthedocs.io")
homepage.delete_suffix!(".git") if homepage.start_with?("https://github.com")
corrector.replace(node.source_range, "\"#{homepage}\"")