diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index 8c0aa971bb..4322777fc9 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -514,7 +514,7 @@ module Cask end # 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:) children.delete(ds_store) end diff --git a/Library/Homebrew/cli/named_args.rb b/Library/Homebrew/cli/named_args.rb index f74719babb..83931ba902 100644 --- a/Library/Homebrew/cli/named_args.rb +++ b/Library/Homebrew/cli/named_args.rb @@ -147,7 +147,7 @@ module Homebrew {}, T.nilable(T::Hash[ 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| diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb index 2c7e7000d1..3acc2fcf84 100644 --- a/Library/Homebrew/cmd/outdated.rb +++ b/Library/Homebrew/cmd/outdated.rb @@ -177,7 +177,7 @@ module Homebrew sig { returns(T::Array[Formula]) } def outdated_formulae 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], ) end diff --git a/Library/Homebrew/development_tools.rb b/Library/Homebrew/development_tools.rb index 0b0af856d1..6d0408f51b 100644 --- a/Library/Homebrew/development_tools.rb +++ b/Library/Homebrew/development_tools.rb @@ -17,7 +17,7 @@ class DevelopmentTools # 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. (@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 # Homebrew GCCs most frequently; much faster to check this before xcrun elsif (path = HOMEBREW_PREFIX/"bin/#{tool}").executable? diff --git a/Library/Homebrew/extend/os/linux/development_tools.rb b/Library/Homebrew/extend/os/linux/development_tools.rb index 4eca2660bb..e65e5f8043 100644 --- a/Library/Homebrew/extend/os/linux/development_tools.rb +++ b/Library/Homebrew/extend/os/linux/development_tools.rb @@ -20,7 +20,7 @@ module OS glibc_path elsif (homebrew_path = HOMEBREW_PREFIX/"bin/#{tool}").executable? homebrew_path - elsif File.executable?((system_path = "/usr/bin/#{tool}")) + elsif File.executable?(system_path = "/usr/bin/#{tool}") Pathname.new system_path end end diff --git a/Library/Homebrew/sbom.rb b/Library/Homebrew/sbom.rb index 6e3e0c2a55..8873cdf751 100644 --- a/Library/Homebrew/sbom.rb +++ b/Library/Homebrew/sbom.rb @@ -192,7 +192,7 @@ class SBOM T::Array[ T::Hash[ Symbol, - T.any(String, T::Array[T::Hash[Symbol, String]]) + T.any(String, T::Array[T::Hash[Symbol, String]]), ], ], ) diff --git a/Library/Homebrew/test/cask/pkg_spec.rb b/Library/Homebrew/test/cask/pkg_spec.rb index a0513c2053..119b79513b 100644 --- a/Library/Homebrew/test/cask/pkg_spec.rb +++ b/Library/Homebrew/test/cask/pkg_spec.rb @@ -118,7 +118,7 @@ RSpec.describe Cask::Pkg, :cask do pkg.uninstall 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) expect(fake_file).to be_a_file diff --git a/Library/Homebrew/utils/tar.rb b/Library/Homebrew/utils/tar.rb index dd1dca89dc..8614ee0ec3 100644 --- a/Library/Homebrew/utils/tar.rb +++ b/Library/Homebrew/utils/tar.rb @@ -22,7 +22,7 @@ module Utils gnu_tar_gtar_path = HOMEBREW_PREFIX/"opt/gnu-tar/bin/gtar" 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 sig { params(path: T.any(Pathname, String)).void }