Skip to content

Commit

Permalink
Merge pull request Homebrew#16501 from issyl0/rubocop-new-rules-style…
Browse files Browse the repository at this point in the history
…-redundant-freeze

Fix RuboCop `Style/RedundantFreeze` offenses
  • Loading branch information
issyl0 authored Jan 19, 2024
2 parents bc5e422 + f682147 commit c63723b
Show file tree
Hide file tree
Showing 57 changed files with 93 additions and 95 deletions.
2 changes: 0 additions & 2 deletions Library/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -461,5 +461,3 @@ Style/ArgumentsForwarding:
Enabled: false
Style/HashSyntax:
EnforcedShorthandSyntax: either
Style/RedundantFreeze:
Enabled: false
6 changes: 3 additions & 3 deletions Library/Homebrew/cask/dsl/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class Version < ::String
"_" => :underscores,
}.freeze

DIVIDER_REGEX = /(#{DIVIDERS.keys.map { |v| Regexp.quote(v) }.join("|")})/.freeze
DIVIDER_REGEX = /(#{DIVIDERS.keys.map { |v| Regexp.quote(v) }.join("|")})/

MAJOR_MINOR_PATCH_REGEX = /^([^.,:]+)(?:.([^.,:]+)(?:.([^.,:]+))?)?/.freeze
MAJOR_MINOR_PATCH_REGEX = /^([^.,:]+)(?:.([^.,:]+)(?:.([^.,:]+))?)?/

INVALID_CHARACTERS = /[^0-9a-zA-Z.,:\-_+ ]/.freeze
INVALID_CHARACTERS = /[^0-9a-zA-Z.,:\-_+ ]/

class << self
private
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/cli/named_args.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ def to_resolved_formulae_to_casks(only: parent&.only_formula_or_cask)
to_formulae_to_casks(only: only, method: :resolve)
end

LOCAL_PATH_REGEX = %r{^/|[.]|/$}.freeze
TAP_NAME_REGEX = %r{^[^./]+/[^./]+$}.freeze
LOCAL_PATH_REGEX = %r{^/|[.]|/$}
TAP_NAME_REGEX = %r{^[^./]+/[^./]+$}
private_constant :LOCAL_PATH_REGEX, :TAP_NAME_REGEX

# Keep existing paths and try to convert others to tap, formula or cask paths.
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cmd/update-report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ def diff
# Hack `git diff` output with regexes to look like `git diff-tree` output.
# Yes, I know this is a bit filthy but it saves duplicating the #report logic.
diff_output = Utils.popen_read("git", "diff", "--no-ext-diff", api_names_before_txt, api_names_txt)
header_regex = /^(---|\+\+\+) /.freeze
header_regex = /^(---|\+\+\+) /
add_delete_characters = ["+", "-"].freeze

diff_output.lines.map do |line|
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module Commands
# dot as a full stop if it is either followed by a whitespace or at the end of
# the description. In this way we can prevent cutting off a sentence in the
# middle due to dots in URLs or paths.
DESCRIPTION_SPLITTING_PATTERN = /\.(?>\s|$)/.freeze
DESCRIPTION_SPLITTING_PATTERN = /\.(?>\s|$)/

def self.valid_internal_cmd?(cmd)
require?(HOMEBREW_CMD_PATH/cmd)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/compilers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# @private
module CompilerConstants
GNU_GCC_VERSIONS = %w[4.9 5 6 7 8 9 10 11 12 13].freeze
GNU_GCC_REGEXP = /^gcc-(4\.9|[5-9]|10|11|12|13)$/.freeze
GNU_GCC_REGEXP = /^gcc-(4\.9|[5-9]|10|11|12|13)$/
COMPILER_SYMBOL_MAP = {
"gcc" => :gcc,
"clang" => :clang,
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/extract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def with_monkey_patch
end

module Homebrew
BOTTLE_BLOCK_REGEX = / bottle (?:do.+?end|:[a-z]+)\n\n/m.freeze
BOTTLE_BLOCK_REGEX = / bottle (?:do.+?end|:[a-z]+)\n\n/m

sig { returns(CLI::Parser) }
def self.extract_args
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/extend/blank.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def present? # :nodoc:
end

class String
BLANK_RE = /\A[[:space:]]*\z/.freeze
BLANK_RE = /\A[[:space:]]*\z/
# This is a cache that is intentionally mutable
# rubocop:disable Style/MutableConstant
ENCODED_BLANKS_ = T.let(Hash.new do |h, enc|
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/extend/os/mac/keg_relocate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def fixed_name(file, bad_name)
end
end

VARIABLE_REFERENCE_RX = /^@(loader_|executable_|r)path/.freeze
VARIABLE_REFERENCE_RX = /^@(loader_|executable_|r)path/

def each_linkage_for(file, linkage_type, resolve_variable_references: false, &block)
file.public_send(linkage_type, resolve_variable_references: resolve_variable_references)
Expand Down Expand Up @@ -159,7 +159,7 @@ def relocated_name_for(old_name, relocation)

# Matches framework references like `XXX.framework/Versions/YYY/XXX` and
# `XXX.framework/XXX`, both with or without a slash-delimited prefix.
FRAMEWORK_RX = %r{(?:^|/)(([^/]+)\.framework/(?:Versions/[^/]+/)?\2)$}.freeze
FRAMEWORK_RX = %r{(?:^|/)(([^/]+)\.framework/(?:Versions/[^/]+/)?\2)$}

def find_dylib_suffix_from(bad_name)
if (framework = bad_name.match(FRAMEWORK_RX))
Expand Down Expand Up @@ -233,7 +233,7 @@ def egrep_args

private

CELLAR_RX = %r{\A#{HOMEBREW_CELLAR}/(?<formula_name>[^/]+)/[^/]+}.freeze
CELLAR_RX = %r{\A#{HOMEBREW_CELLAR}/(?<formula_name>[^/]+)/[^/]+}

# Replace HOMEBREW_CELLAR references with HOMEBREW_PREFIX/opt references
# if the Cellar reference is to a different keg.
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/formulary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
module Formulary
extend Cachable

URL_START_REGEX = %r{(https?|ftp|file)://}.freeze
URL_START_REGEX = %r{(https?|ftp|file)://}

# :codesign and custom requirement classes are not supported
API_SUPPORTED_REQUIREMENTS = [:arch, :linux, :macos, :maximum_macos, :xcode].freeze
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/github_packages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ class GitHubPackages
private_constant :URL_PREFIX
private_constant :DOCKER_PREFIX

URL_REGEX = %r{(?:#{Regexp.escape(URL_PREFIX)}|#{Regexp.escape(DOCKER_PREFIX)})([\w-]+)/([\w-]+)}.freeze
URL_REGEX = %r{(?:#{Regexp.escape(URL_PREFIX)}|#{Regexp.escape(DOCKER_PREFIX)})([\w-]+)/([\w-]+)}

# Valid OCI tag characters
# https://github.com/opencontainers/distribution-spec/blob/main/spec.md#workflow-categories
VALID_OCI_TAG_REGEX = /^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$/.freeze
INVALID_OCI_TAG_CHARS_REGEX = /[^a-zA-Z0-9._-]/.freeze
VALID_OCI_TAG_REGEX = /^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$/
INVALID_OCI_TAG_CHARS_REGEX = /[^a-zA-Z0-9._-]/

GZIP_BUFFER_SIZE = 64 * 1024
private_constant :GZIP_BUFFER_SIZE
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/github_releases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class GitHubReleases
include Context

URL_REGEX = %r{https://github\.com/([\w-]+)/([\w-]+)?/releases/download/(.+)}.freeze
URL_REGEX = %r{https://github\.com/([\w-]+)/([\w-]+)?/releases/download/(.+)}

sig { params(bottles_hash: T::Hash[String, T.untyped]).void }
def upload_bottles(bottles_hash)
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/global.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
HOMEBREW_MACOS_OLDEST_ALLOWED = ENV.fetch("HOMEBREW_MACOS_OLDEST_ALLOWED").freeze

HOMEBREW_PULL_API_REGEX =
%r{https://api\.github\.com/repos/([\w-]+)/([\w-]+)?/pulls/(\d+)}.freeze
%r{https://api\.github\.com/repos/([\w-]+)/([\w-]+)?/pulls/(\d+)}
HOMEBREW_PULL_OR_COMMIT_URL_REGEX =
%r[https://github\.com/([\w-]+)/([\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})].freeze
HOMEBREW_BOTTLES_EXTNAME_REGEX = /\.([a-z0-9_]+)\.bottle\.(?:(\d+)\.)?tar\.gz$/.freeze
%r[https://github\.com/([\w-]+)/([\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})]
HOMEBREW_BOTTLES_EXTNAME_REGEX = /\.([a-z0-9_]+)\.bottle\.(?:(\d+)\.)?tar\.gz$/

require "extend/module"
require "extend/blank"
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/keg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def to_s
end

# Locale-specific directories have the form `language[_territory][.codeset][@modifier]`
LOCALEDIR_RX = %r{(locale|man)/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?}.freeze
INFOFILE_RX = %r{info/([^.].*?\.info|dir)$}.freeze
LOCALEDIR_RX = %r{(locale|man)/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?}
INFOFILE_RX = %r{info/([^.].*?\.info|dir)$}
KEG_LINK_DIRECTORIES = %w[
bin etc include lib sbin share var
].freeze
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/keg_relocate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Keg
NULL_BYTE_STRING = "\\x00"

class Relocation
RELOCATABLE_PATH_REGEX_PREFIX = /(?:(?<=-F|-I|-L|-isystem)|(?<![a-zA-Z0-9]))/.freeze
RELOCATABLE_PATH_REGEX_PREFIX = /(?:(?<=-F|-I|-L|-isystem)|(?<![a-zA-Z0-9]))/

def initialize
@replacement_map = {}
Expand Down Expand Up @@ -83,7 +83,7 @@ def relocate_dynamic_linkage(_relocation)
[]
end

JAVA_REGEX = %r{#{HOMEBREW_PREFIX}/opt/openjdk(@\d+(\.\d+)*)?/libexec(/openjdk\.jdk/Contents/Home)?}.freeze
JAVA_REGEX = %r{#{HOMEBREW_PREFIX}/opt/openjdk(@\d+(\.\d+)*)?/libexec(/openjdk\.jdk/Contents/Home)?}

def prepare_relocation_to_placeholders
relocation = Relocation.new
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/language/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module Shebang
module_function

# A regex to match potential shebang permutations.
NODE_SHEBANG_REGEX = %r{^#! ?/usr/bin/(?:env )?node( |$)}.freeze
NODE_SHEBANG_REGEX = %r{^#! ?/usr/bin/(?:env )?node( |$)}

# The length of the longest shebang matching `SHEBANG_REGEX`.
NODE_SHEBANG_MAX_LENGTH = "#! /usr/bin/env node ".length
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/language/perl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Shebang
module_function

# A regex to match potential shebang permutations.
PERL_SHEBANG_REGEX = %r{^#! ?/usr/bin/(?:env )?perl( |$)}.freeze
PERL_SHEBANG_REGEX = %r{^#! ?/usr/bin/(?:env )?perl( |$)}

# The length of the longest shebang matching `SHEBANG_REGEX`.
PERL_SHEBANG_MAX_LENGTH = "#! /usr/bin/env perl ".length
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/language/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module Shebang
module_function

# A regex to match potential shebang permutations.
PYTHON_SHEBANG_REGEX = %r{^#! ?/usr/bin/(?:env )?python(?:[23](?:\.\d{1,2})?)?( |$)}.freeze
PYTHON_SHEBANG_REGEX = %r{^#! ?/usr/bin/(?:env )?python(?:[23](?:\.\d{1,2})?)?( |$)}

# The length of the longest shebang matching `SHEBANG_REGEX`.
PYTHON_SHEBANG_MAX_LENGTH = "#! /usr/bin/env pythonx.yyy ".length
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/livecheck/strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module Strategy
(?:ar(?:\.(?:bz2|gz|lz|lzma|lzo|xz|Z|zst))?|
b2|bz2?|z2|az|gz|lz|lzma|xz|Z|aZ|zst)
$
/ix.freeze
/ix

# An error message to use when a `strategy` block returns a value of
# an inappropriate type.
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/livecheck/strategy/apache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Apache
(?<prefix>[^/]*?) # Any text in filename or directory before version
v?\d+(?:\.\d+)+ # The numeric version
(?<suffix>/|[^/]*) # Any text in filename or directory after version
}ix.freeze
}ix

# Whether the strategy can be applied to the provided URL.
#
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/livecheck/strategy/bitbucket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Bitbucket
/(?<prefix>(?:[^/]+?[_-])?) # Filename text before the version
v?\d+(?:\.\d+)+ # The numeric version
(?<suffix>[^/]+) # Filename text after the version
}ix.freeze
}ix

# Whether the strategy can be applied to the provided URL.
#
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/livecheck/strategy/cpan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Cpan
(?<prefix>[^/]+) # Filename text before the version
-v?\d+(?:\.\d+)* # The numeric version
(?<suffix>[^/]+) # Filename text after the version
}ix.freeze
}ix

# Whether the strategy can be applied to the provided URL.
#
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/livecheck/strategy/electron_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ElectronBuilder
PRIORITY = 0

# The `Regexp` used to determine if the strategy applies to the URL.
URL_MATCH_REGEX = %r{^https?://.+/[^/]+\.ya?ml(?:\?[^/?]+)?$}i.freeze
URL_MATCH_REGEX = %r{^https?://.+/[^/]+\.ya?ml(?:\?[^/?]+)?$}i

# Whether the strategy can be applied to the provided URL.
#
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/livecheck/strategy/extract_plist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ExtractPlist
PRIORITY = 0

# The `Regexp` used to determine if the strategy applies to the URL.
URL_MATCH_REGEX = %r{^https?://}i.freeze
URL_MATCH_REGEX = %r{^https?://}i

# Whether the strategy can be applied to the provided URL.
#
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/livecheck/strategy/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Git

# The default regex used to naively identify versions from tags when a
# regex isn't provided.
DEFAULT_REGEX = /\D*(.+)/.freeze
DEFAULT_REGEX = /\D*(.+)/

# Whether the strategy can be applied to the provided URL.
#
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/livecheck/strategy/github_releases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ class GithubReleases
^https?://github\.com
/(?:downloads/)?(?<username>[^/]+) # The GitHub username
/(?<repository>[^/]+) # The GitHub repository name
}ix.freeze
}ix

# The default regex used to identify a version from a tag when a regex
# isn't provided.
DEFAULT_REGEX = /v?(\d+(?:\.\d+)+)/i.freeze
DEFAULT_REGEX = /v?(\d+(?:\.\d+)+)/i

# Keys in the release JSON that could contain the version.
# The tag name is checked first, to better align with the {Git}
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/livecheck/strategy/gnome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Gnome
^https?://download\.gnome\.org
/sources
/(?<package_name>[^/]+)/ # The GNOME package name
}ix.freeze
}ix

# Whether the strategy can be applied to the provided URL.
#
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/livecheck/strategy/gnu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Gnu
^https?://
(?:(?:[^/]+?\.)*gnu\.org/(?:gnu|software)/(?<project_name>[^/]+)/
|(?<project_name>[^/]+)\.gnu\.org/?$)
}ix.freeze
}ix

# Whether the strategy can be applied to the provided URL.
#
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/livecheck/strategy/hackage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ module Strategy
class Hackage
# A `Regexp` used in determining if the strategy applies to the URL and
# also as part of extracting the package name from the URL basename.
PACKAGE_NAME_REGEX = /(?<package_name>.+?)-\d+/i.freeze
PACKAGE_NAME_REGEX = /(?<package_name>.+?)-\d+/i

# A `Regexp` used to extract the package name from the URL basename.
FILENAME_REGEX = /^#{PACKAGE_NAME_REGEX.source.strip}/i.freeze
FILENAME_REGEX = /^#{PACKAGE_NAME_REGEX.source.strip}/i

# A `Regexp` used in determining if the strategy applies to the URL.
URL_MATCH_REGEX = %r{
^https?://(?:downloads|hackage)\.haskell\.org
(?:/[^/]+)+ # Path before the filename
#{PACKAGE_NAME_REGEX.source.strip}
}ix.freeze
}ix

# Whether the strategy can be applied to the provided URL.
#
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/livecheck/strategy/header_match.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class HeaderMatch
PRIORITY = 0

# The `Regexp` used to determine if the strategy applies to the URL.
URL_MATCH_REGEX = %r{^https?://}i.freeze
URL_MATCH_REGEX = %r{^https?://}i

# The header fields to check when a `strategy` block isn't provided.
DEFAULT_HEADERS_TO_CHECK = ["content-disposition", "location"].freeze
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/livecheck/strategy/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Json
PRIORITY = 0

# The `Regexp` used to determine if the strategy applies to the URL.
URL_MATCH_REGEX = %r{^https?://}i.freeze
URL_MATCH_REGEX = %r{^https?://}i

# Whether the strategy can be applied to the provided URL.
# {Json} will technically match any HTTP URL but is only usable with
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/livecheck/strategy/launchpad.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class Launchpad
URL_MATCH_REGEX = %r{
^https?://(?:[^/]+?\.)*launchpad\.net
/(?<project_name>[^/]+) # The Launchpad project name
}ix.freeze
}ix

# The default regex used to identify the latest version when a regex
# isn't provided.
DEFAULT_REGEX = %r{class="[^"]*version[^"]*"[^>]*>\s*Latest version is (.+)\s*</}.freeze
DEFAULT_REGEX = %r{class="[^"]*version[^"]*"[^>]*>\s*Latest version is (.+)\s*</}

# Whether the strategy can be applied to the provided URL.
#
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/livecheck/strategy/npm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Npm
URL_MATCH_REGEX = %r{
^https?://registry\.npmjs\.org
/(?<package_name>.+?)/-/ # The npm package name
}ix.freeze
}ix

# Whether the strategy can be applied to the provided URL.
#
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/livecheck/strategy/page_match.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PageMatch
PRIORITY = 0

# The `Regexp` used to determine if the strategy applies to the URL.
URL_MATCH_REGEX = %r{^https?://}i.freeze
URL_MATCH_REGEX = %r{^https?://}i

# Whether the strategy can be applied to the provided URL.
# {PageMatch} will technically match any HTTP URL but is only
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/livecheck/strategy/pypi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ class Pypi
(?<package_name>.+)- # The package name followed by a hyphen
.*? # The version string
(?<suffix>\.tar\.[a-z0-9]+|\.[a-z0-9]+)$ # Filename extension
/ix.freeze
/ix

# The `Regexp` used to determine if the strategy applies to the URL.
URL_MATCH_REGEX = %r{
^https?://files\.pythonhosted\.org
/packages
(?:/[^/]+)+ # The hexadecimal paths before the filename
/#{FILENAME_REGEX.source.strip} # The filename
}ix.freeze
}ix

# Whether the strategy can be applied to the provided URL.
#
Expand Down
Loading

0 comments on commit c63723b

Please sign in to comment.