From aa36b343cab9a998d6e5359df8921200ba37ba3f Mon Sep 17 00:00:00 2001 From: Issy Long Date: Fri, 15 Apr 2022 16:39:14 +0100 Subject: [PATCH] rubocops/urls: Escape `.`s in hostnames in regexps --- Library/Homebrew/rubocops/urls.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/rubocops/urls.rb b/Library/Homebrew/rubocops/urls.rb index 963dc1980f..dfabc03859 100644 --- a/Library/Homebrew/rubocops/urls.rb +++ b/Library/Homebrew/rubocops/urls.rb @@ -21,7 +21,7 @@ module RuboCop end # GNU URLs; doesn't apply to mirrors - gnu_pattern = %r{^(?:https?|ftp)://ftpmirror.gnu.org/(.*)} + gnu_pattern = %r{^(?:https?|ftp)://ftpmirror\.gnu\.org/(.*)} audit_urls(urls, gnu_pattern) do |match, url| problem "Please use \"https://ftp.gnu.org/gnu/#{match[1]}\" instead of #{url}." end @@ -267,13 +267,13 @@ module RuboCop urls += mirrors # Check pypi URLs - pypi_pattern = %r{^https?://pypi.python.org/} + pypi_pattern = %r{^https?://pypi\.python\.org/} audit_urls(urls, pypi_pattern) do |_, url| problem "use the `Source` url found on PyPI downloads page (`#{get_pypi_url(url)}`)" end # Require long files.pythonhosted.org URLs - pythonhosted_pattern = %r{^https?://files.pythonhosted.org/packages/source/} + pythonhosted_pattern = %r{^https?://files\.pythonhosted\.org/packages/source/} audit_urls(urls, pythonhosted_pattern) do |_, url| problem "use the `Source` url found on PyPI downloads page (`#{get_pypi_url(url)}`)" end