Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps-dev): bump rubocop from 1.67.0 to 1.68.0 in /Library/Homebrew #18682

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Library/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@ Style/OptionalBooleanParameter:
- respond_to?
- respond_to_missing?

# Broken in RuboCop 1.68.0 so tries to fix line continuations in inline patch blocks:
# https://github.com/Homebrew/brew/actions/runs/11653110391/job/32460881827?pr=18682
Style/RedundantLineContinuation:
Enabled: false

# Rescuing `StandardError` is an understood default.
Style/RescueStandardError:
EnforcedStyle: implicit
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ GEM
rspec-support (3.13.1)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.67.0)
rubocop (1.68.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/cask/cask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@
sig { returns(T.nilable(Time)) }
def install_time
# <caskroom_path>/.metadata/<version>/<timestamp>/Casks/<token>.{rb,json} -> <timestamp>
time = installed_caskfile&.dirname&.dirname&.basename&.to_s
Time.strptime(time, Metadata::TIMESTAMP_FORMAT) if time
caskfile = installed_caskfile

Check warning on line 176 in Library/Homebrew/cask/cask.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cask/cask.rb#L176

Added line #L176 was not covered by tests
Time.strptime(caskfile.dirname.dirname.basename.to_s, Metadata::TIMESTAMP_FORMAT) if caskfile
end

sig { returns(T.nilable(Pathname)) }
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/cask/quarantine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ def self.app_management_permissions_granted?(app:, command:)
# including both file ownership and whether system permissions are granted.
# Here we just want to check whether sudo would be needed.
looks_writable_without_sudo = if app.owned?
(app.lstat.mode & 0200) != 0
app.lstat.mode.anybits?(0200)
elsif app.grpowned?
(app.lstat.mode & 0020) != 0
app.lstat.mode.anybits?(0020)
else
(app.lstat.mode & 0002) != 0
app.lstat.mode.anybits?(0002)
end

if looks_writable_without_sudo
Expand Down
5 changes: 3 additions & 2 deletions Library/Homebrew/cleanup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ def stale_formula?(pathname, scrub)

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

stable = formula.stable
if resource_name == "patch"
patch_hashes = formula.stable&.patches&.select(&:external?)&.map(&:resource)&.map(&:version)
patch_hashes = stable&.patches&.filter_map { _1.resource.version if _1.external? }
return true unless patch_hashes&.include?(Checksum.new(version.to_s))
elsif resource_name && (resource_version = formula.stable&.resources&.dig(resource_name)&.version)
elsif resource_name && stable && (resource_version = stable.resources[resource_name]&.version)
return true if resource_version != version
elsif (formula.latest_version_installed? && formula.pkg_version.to_s != version) ||
formula.pkg_version.to_s > version
Expand Down
6 changes: 5 additions & 1 deletion Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,11 @@ def oldnames
# @api internal
sig { returns(T::Array[String]) }
def aliases
MikeMcQuaid marked this conversation as resolved.
Show resolved Hide resolved
@aliases ||= tap&.alias_reverse_table&.dig(full_name)&.map { _1.split("/").last } || []
@aliases ||= if (tap = self.tap)
tap.alias_reverse_table.fetch(full_name, []).map { _1.split("/").last }
else
[]
end
end

# The {Resource}s for the currently active {SoftwareSpec}.
Expand Down
10 changes: 6 additions & 4 deletions Library/Homebrew/formulary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,12 @@ def post_install_defined?

@caveats_string = json_formula["caveats"]
def caveats
self.class.instance_variable_get(:@caveats_string)
&.gsub(HOMEBREW_PREFIX_PLACEHOLDER, HOMEBREW_PREFIX)
&.gsub(HOMEBREW_CELLAR_PLACEHOLDER, HOMEBREW_CELLAR)
&.gsub(HOMEBREW_HOME_PLACEHOLDER, Dir.home)
caveats_string = self.class.instance_variable_get(:@caveats_string)
return unless caveats_string

caveats_string.gsub(HOMEBREW_PREFIX_PLACEHOLDER, HOMEBREW_PREFIX)
.gsub(HOMEBREW_CELLAR_PLACEHOLDER, HOMEBREW_CELLAR)
.gsub(HOMEBREW_HOME_PLACEHOLDER, Dir.home)
end

@tap_git_head_string = if Homebrew::API.internal_json_v3?
Expand Down
11 changes: 7 additions & 4 deletions Library/Homebrew/livecheck/livecheck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,13 @@ def self.run_checks(
extract_plist = true if formulae_and_casks_total == 1

formulae_checked = formulae_and_casks_to_check.map.with_index do |formula_or_cask, i|
formula = formula_or_cask if formula_or_cask.is_a?(Formula)
cask = formula_or_cask if formula_or_cask.is_a?(Cask::Cask)
case formula_or_cask
when Formula
formula = formula_or_cask
formula.head&.downloader&.quiet!
dduugg marked this conversation as resolved.
Show resolved Hide resolved
when Cask::Cask
cask = formula_or_cask
end

use_full_name = full_name || ambiguous_names.include?(formula_or_cask)
name = package_or_resource_name(formula_or_cask, full_name: use_full_name)
Expand Down Expand Up @@ -238,8 +243,6 @@ def self.run_checks(
next
end

formula&.head&.downloader&.quiet!

# Use the `stable` version for comparison except for installed
# head-only formulae. A formula with `stable` and `head` that's
# installed using `--head` will still use the `stable` version for
Expand Down
Loading
Loading