rubocop: Drop "v" from Naming/MethodParameterName
allowlist
- This was an easy fix, "v" => "version".
This commit is contained in:
parent
23abe37234
commit
3e7a46f474
@ -205,7 +205,6 @@ Naming/MethodParameterName:
|
|||||||
"r",
|
"r",
|
||||||
"rb",
|
"rb",
|
||||||
"s",
|
"s",
|
||||||
"v",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Both styles are used depending on context,
|
# Both styles are used depending on context,
|
||||||
|
@ -622,9 +622,9 @@ class Formula
|
|||||||
# This directory points to {#opt_prefix} if it exists and if #{prefix} is not
|
# This directory points to {#opt_prefix} if it exists and if #{prefix} is not
|
||||||
# called from within the same formula's {#install} or {#post_install} methods.
|
# called from within the same formula's {#install} or {#post_install} methods.
|
||||||
# Otherwise, return the full path to the formula's versioned cellar.
|
# Otherwise, return the full path to the formula's versioned cellar.
|
||||||
def prefix(v = pkg_version)
|
def prefix(version = pkg_version)
|
||||||
versioned_prefix = versioned_prefix(v)
|
versioned_prefix = versioned_prefix(version)
|
||||||
if !@prefix_returns_versioned_prefix && v == pkg_version &&
|
if !@prefix_returns_versioned_prefix && version == pkg_version &&
|
||||||
versioned_prefix.directory? && Keg.new(versioned_prefix).optlinked?
|
versioned_prefix.directory? && Keg.new(versioned_prefix).optlinked?
|
||||||
opt_prefix
|
opt_prefix
|
||||||
else
|
else
|
||||||
@ -643,10 +643,10 @@ class Formula
|
|||||||
end
|
end
|
||||||
|
|
||||||
# If a formula's linked keg points to the prefix.
|
# If a formula's linked keg points to the prefix.
|
||||||
def prefix_linked?(v = pkg_version)
|
def prefix_linked?(version = pkg_version)
|
||||||
return false unless linked?
|
return false unless linked?
|
||||||
|
|
||||||
linked_keg.resolved_path == versioned_prefix(v)
|
linked_keg.resolved_path == versioned_prefix(version)
|
||||||
end
|
end
|
||||||
|
|
||||||
# {PkgVersion} of the linked keg for the formula.
|
# {PkgVersion} of the linked keg for the formula.
|
||||||
@ -2636,8 +2636,8 @@ class Formula
|
|||||||
|
|
||||||
# Returns the prefix for a given formula version number.
|
# Returns the prefix for a given formula version number.
|
||||||
# @private
|
# @private
|
||||||
def versioned_prefix(v)
|
def versioned_prefix(version)
|
||||||
rack/v
|
rack/version
|
||||||
end
|
end
|
||||||
|
|
||||||
def exec_cmd(cmd, args, out, logfn)
|
def exec_cmd(cmd, args, out, logfn)
|
||||||
|
@ -78,7 +78,7 @@ module OS
|
|||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
def sdk_path_if_needed(_v = nil)
|
def sdk_path_if_needed(_version = nil)
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -113,11 +113,11 @@ module OS
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def sdk(v = nil)
|
def sdk(version = nil)
|
||||||
sdk_locator.sdk_if_applicable(v)
|
sdk_locator.sdk_if_applicable(version)
|
||||||
end
|
end
|
||||||
|
|
||||||
def sdk_for_formula(f, v = nil, check_only_runtime_requirements: false)
|
def sdk_for_formula(f, version = nil, check_only_runtime_requirements: false)
|
||||||
# If the formula requires Xcode, don't return the CLT SDK
|
# If the formula requires Xcode, don't return the CLT SDK
|
||||||
# If check_only_runtime_requirements is true, don't necessarily return the
|
# If check_only_runtime_requirements is true, don't necessarily return the
|
||||||
# Xcode SDK if the XcodeRequirement is only a build or test requirement.
|
# Xcode SDK if the XcodeRequirement is only a build or test requirement.
|
||||||
@ -128,16 +128,16 @@ module OS
|
|||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
sdk(v)
|
sdk(version)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the path to an SDK or nil, following the rules set by {sdk}.
|
# Returns the path to an SDK or nil, following the rules set by {sdk}.
|
||||||
def sdk_path(v = nil)
|
def sdk_path(version = nil)
|
||||||
s = sdk(v)
|
s = sdk(version)
|
||||||
s&.path
|
s&.path
|
||||||
end
|
end
|
||||||
|
|
||||||
def sdk_path_if_needed(v = nil)
|
def sdk_path_if_needed(version = nil)
|
||||||
# Prefer CLT SDK when both Xcode and the CLT are installed.
|
# Prefer CLT SDK when both Xcode and the CLT are installed.
|
||||||
# Expected results:
|
# Expected results:
|
||||||
# 1. On Xcode-only systems, return the Xcode SDK.
|
# 1. On Xcode-only systems, return the Xcode SDK.
|
||||||
@ -148,7 +148,7 @@ module OS
|
|||||||
|
|
||||||
return unless sdk_root_needed?
|
return unless sdk_root_needed?
|
||||||
|
|
||||||
sdk_path(v)
|
sdk_path(version)
|
||||||
end
|
end
|
||||||
|
|
||||||
# See these issues for some history:
|
# See these issues for some history:
|
||||||
|
@ -42,9 +42,9 @@ module OS
|
|||||||
|
|
||||||
class NoSDKError < StandardError; end
|
class NoSDKError < StandardError; end
|
||||||
|
|
||||||
sig { params(v: OS::Mac::Version).returns(SDK) }
|
sig { params(version: OS::Mac::Version).returns(SDK) }
|
||||||
def sdk_for(v)
|
def sdk_for(version)
|
||||||
sdk = all_sdks.find { |s| s.version == v }
|
sdk = all_sdks.find { |s| s.version == version }
|
||||||
raise NoSDKError if sdk.nil?
|
raise NoSDKError if sdk.nil?
|
||||||
|
|
||||||
sdk
|
sdk
|
||||||
@ -80,13 +80,13 @@ module OS
|
|||||||
@all_sdks
|
@all_sdks
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(v: T.nilable(OS::Mac::Version)).returns(T.nilable(SDK)) }
|
sig { params(version: T.nilable(OS::Mac::Version)).returns(T.nilable(SDK)) }
|
||||||
def sdk_if_applicable(v = nil)
|
def sdk_if_applicable(version = nil)
|
||||||
sdk = begin
|
sdk = begin
|
||||||
if v.blank?
|
if version.blank?
|
||||||
sdk_for OS::Mac.version
|
sdk_for OS::Mac.version
|
||||||
else
|
else
|
||||||
sdk_for v
|
sdk_for version
|
||||||
end
|
end
|
||||||
rescue NoSDKError
|
rescue NoSDKError
|
||||||
latest_sdk
|
latest_sdk
|
||||||
@ -95,7 +95,7 @@ module OS
|
|||||||
|
|
||||||
# On OSs lower than 11, whenever the major versions don't match,
|
# On OSs lower than 11, whenever the major versions don't match,
|
||||||
# only return an SDK older than the OS version if it was specifically requested
|
# only return an SDK older than the OS version if it was specifically requested
|
||||||
return if v.blank? && sdk.version < OS::Mac.version
|
return if version.blank? && sdk.version < OS::Mac.version
|
||||||
|
|
||||||
sdk
|
sdk
|
||||||
end
|
end
|
||||||
|
@ -140,14 +140,14 @@ module OS
|
|||||||
@sdk_locator ||= XcodeSDKLocator.new
|
@sdk_locator ||= XcodeSDKLocator.new
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(v: T.nilable(MacOS::Version)).returns(T.nilable(SDK)) }
|
sig { params(version: T.nilable(MacOS::Version)).returns(T.nilable(SDK)) }
|
||||||
def sdk(v = nil)
|
def sdk(version = nil)
|
||||||
sdk_locator.sdk_if_applicable(v)
|
sdk_locator.sdk_if_applicable(version)
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(v: T.nilable(MacOS::Version)).returns(T.nilable(Pathname)) }
|
sig { params(version: T.nilable(MacOS::Version)).returns(T.nilable(Pathname)) }
|
||||||
def sdk_path(v = nil)
|
def sdk_path(version = nil)
|
||||||
sdk(v)&.path
|
sdk(version)&.path
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
@ -290,14 +290,14 @@ module OS
|
|||||||
@sdk_locator ||= CLTSDKLocator.new
|
@sdk_locator ||= CLTSDKLocator.new
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(v: T.nilable(MacOS::Version)).returns(T.nilable(SDK)) }
|
sig { params(version: T.nilable(MacOS::Version)).returns(T.nilable(SDK)) }
|
||||||
def sdk(v = nil)
|
def sdk(version = nil)
|
||||||
sdk_locator.sdk_if_applicable(v)
|
sdk_locator.sdk_if_applicable(version)
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(v: T.nilable(MacOS::Version)).returns(T.nilable(Pathname)) }
|
sig { params(version: T.nilable(MacOS::Version)).returns(T.nilable(Pathname)) }
|
||||||
def sdk_path(v = nil)
|
def sdk_path(version = nil)
|
||||||
sdk(v)&.path
|
sdk(version)&.path
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user