brew style --fix

This commit is contained in:
Mike McQuaid 2023-04-04 15:37:24 +01:00 committed by Issy Long
parent 992025dc1a
commit 63d8de3600
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4
7 changed files with 13 additions and 13 deletions

View File

@ -56,7 +56,7 @@ module Cask
message = "It seems there is already #{self.class.english_article} " \ message = "It seems there is already #{self.class.english_article} " \
"#{self.class.english_name} at '#{target}'" "#{self.class.english_name} at '#{target}'"
if force && target.symlink? && \ if force && target.symlink? &&
(target.realpath == source.realpath || target.realpath.to_s.start_with?("#{cask.caskroom_path}/")) (target.realpath == source.realpath || target.realpath.to_s.start_with?("#{cask.caskroom_path}/"))
opoo "#{message}; overwriting." opoo "#{message}; overwriting."
target.delete target.delete

View File

@ -72,7 +72,7 @@ module Homebrew
ambiguous_casks = [] ambiguous_casks = []
if !args.formula? && !args.cask? if !args.formula? && !args.cask?
ambiguous_casks = formulae_and_casks \ ambiguous_casks = formulae_and_casks
.group_by { |item| Livecheck.package_or_resource_name(item, full_name: true) } .group_by { |item| Livecheck.package_or_resource_name(item, full_name: true) }
.values .values
.select { |items| items.length > 1 } .select { |items| items.length > 1 }

View File

@ -182,7 +182,7 @@ module Homebrew
ambiguous_casks = [] ambiguous_casks = []
if handle_name_conflict if handle_name_conflict
ambiguous_casks = formulae_and_casks_to_check \ ambiguous_casks = formulae_and_casks_to_check
.group_by { |item| package_or_resource_name(item, full_name: true) } .group_by { |item| package_or_resource_name(item, full_name: true) }
.values .values
.select { |items| items.length > 1 } .select { |items| items.length > 1 }

View File

@ -360,14 +360,14 @@ class Migrator
# Remove `opt/oldname` link if it belongs to newname. # Remove `opt/oldname` link if it belongs to newname.
def unlink_oldname_opt def unlink_oldname_opt
return unless old_opt_record return if old_opt_record.blank?
return unless old_opt_record.symlink?
return unless old_opt_record.exist?
return unless new_linked_keg_record.exist?
return if new_linked_keg_record.realpath != old_opt_record.realpath
if old_opt_record.symlink? && old_opt_record.exist? \ old_opt_record.unlink
&& new_linked_keg_record.exist? \ old_opt_record.parent.rmdir_if_possible
&& new_linked_keg_record.realpath == old_opt_record.realpath
old_opt_record.unlink
old_opt_record.parent.rmdir_if_possible
end
end end
# Remove `Cellar/oldname` if it exists. # Remove `Cellar/oldname` if it exists.

View File

@ -120,7 +120,7 @@ class SoftwareSpec
end end
def bottled?(tag = nil) def bottled?(tag = nil)
bottle_tag?(tag) && \ bottle_tag?(tag) &&
(tag.present? || bottle_specification.compatible_locations? || owner.force_bottle) (tag.present? || bottle_specification.compatible_locations? || owner.force_bottle)
end end

View File

@ -236,7 +236,7 @@ describe SystemCommand do
"-c", "-c",
'printf "\r%s" "################### 27.6%" 1>&2', 'printf "\r%s" "################### 27.6%" 1>&2',
] ]
end.to output( \ end.to output(
"\r################### 27.6%", "\r################### 27.6%",
).to_stderr ).to_stderr
end end

View File

@ -155,7 +155,7 @@ describe PyPI do
describe "<=>" do describe "<=>" do
it "returns -1" do it "returns -1" do
expect(package <=> other_package).to eq((-1)) expect(package <=> other_package).to eq(-1)
end end
it "returns 0" do it "returns 0" do