mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
brew style --fix
This commit is contained in:
parent
75e184049c
commit
c6a2fa335d
@ -514,7 +514,7 @@ module Cask
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Directory counts as empty if it only contains a `.DS_Store`.
|
# Directory counts as empty if it only contains a `.DS_Store`.
|
||||||
if children.include?((ds_store = resolved_path/".DS_Store"))
|
if children.include?(ds_store = resolved_path/".DS_Store")
|
||||||
Utils.gain_permissions_remove(ds_store, command:)
|
Utils.gain_permissions_remove(ds_store, command:)
|
||||||
children.delete(ds_store)
|
children.delete(ds_store)
|
||||||
end
|
end
|
||||||
|
@ -147,7 +147,7 @@ module Homebrew
|
|||||||
{},
|
{},
|
||||||
T.nilable(T::Hash[
|
T.nilable(T::Hash[
|
||||||
T.nilable(Symbol),
|
T.nilable(Symbol),
|
||||||
T::Array[T.any(Formula, Keg, Cask::Cask, T::Array[Keg], FormulaOrCaskUnavailableError)]
|
T::Array[T.any(Formula, Keg, Cask::Cask, T::Array[Keg], FormulaOrCaskUnavailableError)],
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
@to_formulae_casks_unknowns[method] = downcased_unique_named.map do |name|
|
@to_formulae_casks_unknowns[method] = downcased_unique_named.map do |name|
|
||||||
|
@ -177,7 +177,7 @@ module Homebrew
|
|||||||
sig { returns(T::Array[Formula]) }
|
sig { returns(T::Array[Formula]) }
|
||||||
def outdated_formulae
|
def outdated_formulae
|
||||||
T.cast(
|
T.cast(
|
||||||
select_outdated((args.named.to_resolved_formulae.presence || Formula.installed)).sort,
|
select_outdated(args.named.to_resolved_formulae.presence || Formula.installed).sort,
|
||||||
T::Array[Formula],
|
T::Array[Formula],
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
@ -17,7 +17,7 @@ class DevelopmentTools
|
|||||||
# Give the name of the binary you look for as a string to this method
|
# Give the name of the binary you look for as a string to this method
|
||||||
# in order to get the full path back as a Pathname.
|
# in order to get the full path back as a Pathname.
|
||||||
(@locate ||= T.let({}, T.nilable(T::Hash[T.any(String, Symbol), T.untyped]))).fetch(tool) do |key|
|
(@locate ||= T.let({}, T.nilable(T::Hash[T.any(String, Symbol), T.untyped]))).fetch(tool) do |key|
|
||||||
@locate[key] = if File.executable?((path = "/usr/bin/#{tool}"))
|
@locate[key] = if File.executable?(path = "/usr/bin/#{tool}")
|
||||||
Pathname.new path
|
Pathname.new path
|
||||||
# Homebrew GCCs most frequently; much faster to check this before xcrun
|
# Homebrew GCCs most frequently; much faster to check this before xcrun
|
||||||
elsif (path = HOMEBREW_PREFIX/"bin/#{tool}").executable?
|
elsif (path = HOMEBREW_PREFIX/"bin/#{tool}").executable?
|
||||||
|
@ -20,7 +20,7 @@ module OS
|
|||||||
glibc_path
|
glibc_path
|
||||||
elsif (homebrew_path = HOMEBREW_PREFIX/"bin/#{tool}").executable?
|
elsif (homebrew_path = HOMEBREW_PREFIX/"bin/#{tool}").executable?
|
||||||
homebrew_path
|
homebrew_path
|
||||||
elsif File.executable?((system_path = "/usr/bin/#{tool}"))
|
elsif File.executable?(system_path = "/usr/bin/#{tool}")
|
||||||
Pathname.new system_path
|
Pathname.new system_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -192,7 +192,7 @@ class SBOM
|
|||||||
T::Array[
|
T::Array[
|
||||||
T::Hash[
|
T::Hash[
|
||||||
Symbol,
|
Symbol,
|
||||||
T.any(String, T::Array[T::Hash[Symbol, String]])
|
T.any(String, T::Array[T::Hash[Symbol, String]]),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -118,7 +118,7 @@ RSpec.describe Cask::Pkg, :cask do
|
|||||||
pkg.uninstall
|
pkg.uninstall
|
||||||
|
|
||||||
expect(fake_dir).to be_a_directory
|
expect(fake_dir).to be_a_directory
|
||||||
expect((fake_dir.stat.mode % 01000)).to eq(0)
|
expect(fake_dir.stat.mode % 01000).to eq(0)
|
||||||
|
|
||||||
fake_dir.chmod(0777)
|
fake_dir.chmod(0777)
|
||||||
expect(fake_file).to be_a_file
|
expect(fake_file).to be_a_file
|
||||||
|
@ -22,7 +22,7 @@ module Utils
|
|||||||
|
|
||||||
gnu_tar_gtar_path = HOMEBREW_PREFIX/"opt/gnu-tar/bin/gtar"
|
gnu_tar_gtar_path = HOMEBREW_PREFIX/"opt/gnu-tar/bin/gtar"
|
||||||
gnu_tar_gtar = gnu_tar_gtar_path if gnu_tar_gtar_path.executable?
|
gnu_tar_gtar = gnu_tar_gtar_path if gnu_tar_gtar_path.executable?
|
||||||
@executable = T.let((which("gtar") || gnu_tar_gtar || which("tar")), T.nilable(Pathname))
|
@executable = T.let(which("gtar") || gnu_tar_gtar || which("tar"), T.nilable(Pathname))
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(path: T.any(Pathname, String)).void }
|
sig { params(path: T.any(Pathname, String)).void }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user