Skip to content

Commit 591057e

Browse files
authored
Merge pull request #18682 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-1.68.0
build(deps-dev): bump rubocop from 1.67.0 to 1.68.0 in /Library/Homebrew
2 parents e1c8b33 + 24d3b46 commit 591057e

File tree

13 files changed

+916
-449
lines changed

13 files changed

+916
-449
lines changed

Library/.rubocop.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,11 @@ Style/OptionalBooleanParameter:
420420
- respond_to?
421421
- respond_to_missing?
422422

423+
# Broken in RuboCop 1.68.0 so tries to fix line continuations in inline patch blocks:
424+
# https://github.com/Homebrew/brew/actions/runs/11653110391/job/32460881827?pr=18682
425+
Style/RedundantLineContinuation:
426+
Enabled: false
427+
423428
# Rescuing `StandardError` is an understood default.
424429
Style/RescueStandardError:
425430
EnforcedStyle: implicit

Library/Homebrew/Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ GEM
7272
rspec-support (3.13.1)
7373
rspec_junit_formatter (0.6.0)
7474
rspec-core (>= 2, < 4, != 2.12.0)
75-
rubocop (1.67.0)
75+
rubocop (1.68.0)
7676
json (~> 2.3)
7777
language_server-protocol (>= 3.17.0)
7878
parallel (~> 1.10)

Library/Homebrew/cask/cask.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ def uninstall_flight_blocks?
173173
sig { returns(T.nilable(Time)) }
174174
def install_time
175175
# <caskroom_path>/.metadata/<version>/<timestamp>/Casks/<token>.{rb,json} -> <timestamp>
176-
time = installed_caskfile&.dirname&.dirname&.basename&.to_s
177-
Time.strptime(time, Metadata::TIMESTAMP_FORMAT) if time
176+
caskfile = installed_caskfile
177+
Time.strptime(caskfile.dirname.dirname.basename.to_s, Metadata::TIMESTAMP_FORMAT) if caskfile
178178
end
179179

180180
sig { returns(T.nilable(Pathname)) }

Library/Homebrew/cask/quarantine.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,11 @@ def self.app_management_permissions_granted?(app:, command:)
216216
# including both file ownership and whether system permissions are granted.
217217
# Here we just want to check whether sudo would be needed.
218218
looks_writable_without_sudo = if app.owned?
219-
(app.lstat.mode & 0200) != 0
219+
app.lstat.mode.anybits?(0200)
220220
elsif app.grpowned?
221-
(app.lstat.mode & 0020) != 0
221+
app.lstat.mode.anybits?(0020)
222222
else
223-
(app.lstat.mode & 0002) != 0
223+
app.lstat.mode.anybits?(0002)
224224
end
225225

226226
if looks_writable_without_sudo

Library/Homebrew/cleanup.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,11 @@ def stale_formula?(pathname, scrub)
152152

153153
resource_name = basename_str[/\A.*?--(.*?)--?(?:#{Regexp.escape(version.to_s)})/, 1]
154154

155+
stable = formula.stable
155156
if resource_name == "patch"
156-
patch_hashes = formula.stable&.patches&.select(&:external?)&.map(&:resource)&.map(&:version)
157+
patch_hashes = stable&.patches&.filter_map { _1.resource.version if _1.external? }
157158
return true unless patch_hashes&.include?(Checksum.new(version.to_s))
158-
elsif resource_name && (resource_version = formula.stable&.resources&.dig(resource_name)&.version)
159+
elsif resource_name && stable && (resource_version = stable.resources[resource_name]&.version)
159160
return true if resource_version != version
160161
elsif (formula.latest_version_installed? && formula.pkg_version.to_s != version) ||
161162
formula.pkg_version.to_s > version

Library/Homebrew/formula.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,11 @@ def oldnames
593593
# @api internal
594594
sig { returns(T::Array[String]) }
595595
def aliases
596-
@aliases ||= tap&.alias_reverse_table&.dig(full_name)&.map { _1.split("/").last } || []
596+
@aliases ||= if (tap = self.tap)
597+
tap.alias_reverse_table.fetch(full_name, []).map { _1.split("/").last }
598+
else
599+
[]
600+
end
597601
end
598602

599603
# The {Resource}s for the currently active {SoftwareSpec}.

Library/Homebrew/formulary.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,12 @@ def post_install_defined?
418418

419419
@caveats_string = json_formula["caveats"]
420420
def caveats
421-
self.class.instance_variable_get(:@caveats_string)
422-
&.gsub(HOMEBREW_PREFIX_PLACEHOLDER, HOMEBREW_PREFIX)
423-
&.gsub(HOMEBREW_CELLAR_PLACEHOLDER, HOMEBREW_CELLAR)
424-
&.gsub(HOMEBREW_HOME_PLACEHOLDER, Dir.home)
421+
caveats_string = self.class.instance_variable_get(:@caveats_string)
422+
return unless caveats_string
423+
424+
caveats_string.gsub(HOMEBREW_PREFIX_PLACEHOLDER, HOMEBREW_PREFIX)
425+
.gsub(HOMEBREW_CELLAR_PLACEHOLDER, HOMEBREW_CELLAR)
426+
.gsub(HOMEBREW_HOME_PLACEHOLDER, Dir.home)
425427
end
426428

427429
@tap_git_head_string = if Homebrew::API.internal_json_v3?

Library/Homebrew/livecheck/livecheck.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,13 @@ def self.run_checks(
195195
extract_plist = true if formulae_and_casks_total == 1
196196

197197
formulae_checked = formulae_and_casks_to_check.map.with_index do |formula_or_cask, i|
198-
formula = formula_or_cask if formula_or_cask.is_a?(Formula)
199-
cask = formula_or_cask if formula_or_cask.is_a?(Cask::Cask)
198+
case formula_or_cask
199+
when Formula
200+
formula = formula_or_cask
201+
formula.head&.downloader&.quiet!
202+
when Cask::Cask
203+
cask = formula_or_cask
204+
end
200205

201206
use_full_name = full_name || ambiguous_names.include?(formula_or_cask)
202207
name = package_or_resource_name(formula_or_cask, full_name: use_full_name)
@@ -238,8 +243,6 @@ def self.run_checks(
238243
next
239244
end
240245

241-
formula&.head&.downloader&.quiet!
242-
243246
# Use the `stable` version for comparison except for installed
244247
# head-only formulae. A formula with `stable` and `head` that's
245248
# installed using `--head` will still use the `stable` version for

0 commit comments

Comments
 (0)