mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Fix Rubocop warnings (without brew style --fix
)
This commit is contained in:
parent
fe76a5155b
commit
7a5d4256e5
@ -748,15 +748,13 @@ module Homebrew
|
||||
|
||||
def check_for_unlinked_but_not_keg_only
|
||||
unlinked = Formula.racks.reject do |rack|
|
||||
if (HOMEBREW_LINKED_KEGS/rack.basename).directory?
|
||||
true
|
||||
else
|
||||
next true if (HOMEBREW_LINKED_KEGS/rack.basename).directory?
|
||||
|
||||
begin
|
||||
Formulary.from_rack(rack).keg_only?
|
||||
rescue FormulaUnavailableError, TapFormulaAmbiguityError
|
||||
false
|
||||
end
|
||||
end
|
||||
end.map(&:basename)
|
||||
return if unlinked.empty?
|
||||
|
||||
|
@ -809,11 +809,8 @@ on_request: installed_on_request?, options:)
|
||||
options |= inherited_options
|
||||
options &= df.options
|
||||
|
||||
installed_on_request = if df.any_version_installed? && tab.present? && tab.installed_on_request
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
installed_on_request = df.any_version_installed? && tab.present? && tab.installed_on_request
|
||||
installed_on_request ||= false
|
||||
|
||||
fi = FormulaInstaller.new(
|
||||
df,
|
||||
|
@ -81,13 +81,11 @@ class Locale
|
||||
end
|
||||
|
||||
[:language, :script, :region].all? do |var|
|
||||
if other.public_send(var).nil?
|
||||
true
|
||||
else
|
||||
next true if other.public_send(var).nil?
|
||||
|
||||
public_send(var) == other.public_send(var)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def eql?(other)
|
||||
unless other.is_a?(self.class)
|
||||
|
@ -85,21 +85,15 @@ module Homebrew
|
||||
run_shellcheck(shell_files, output_type, fix:)
|
||||
end
|
||||
|
||||
shfmt_result = if files.present? && shell_files.empty?
|
||||
true
|
||||
else
|
||||
run_shfmt(shell_files, fix:)
|
||||
end
|
||||
shfmt_result = files.present? && shell_files.empty?
|
||||
shfmt_result ||= run_shfmt(shell_files, fix:)
|
||||
|
||||
has_actionlint_workflow = actionlint_files.any? do |path|
|
||||
path.to_s.end_with?("/.github/workflows/actionlint.yml")
|
||||
end
|
||||
odebug "actionlint workflow detected. Skipping actionlint checks." if has_actionlint_workflow
|
||||
actionlint_result = if files.present? && (has_actionlint_workflow || actionlint_files.empty?)
|
||||
true
|
||||
else
|
||||
run_actionlint(actionlint_files)
|
||||
end
|
||||
actionlint_result = files.present? && (has_actionlint_workflow || actionlint_files.empty?)
|
||||
actionlint_result ||= run_actionlint(actionlint_files)
|
||||
|
||||
if output_type == :json
|
||||
Offenses.new(rubocop_result + shellcheck_result)
|
||||
|
@ -71,9 +71,6 @@ module Utils
|
||||
def report_package_event(measurement, package_name:, tap_name:, on_request: false, options: "")
|
||||
return if not_this_run? || disabled?
|
||||
|
||||
# ensure on_request is a boolean
|
||||
on_request = on_request ? true : false
|
||||
|
||||
# ensure options are removed (by `.compact` below) if empty
|
||||
options = nil if options.blank?
|
||||
|
||||
@ -137,9 +134,6 @@ module Utils
|
||||
return if not_this_run? || disabled?
|
||||
return if ENV["HOMEBREW_TEST_BOT_ANALYTICS"].blank?
|
||||
|
||||
# ensure passed is a boolean
|
||||
passed = passed ? true : false
|
||||
|
||||
# Tags must have low cardinality.
|
||||
tags = {
|
||||
passed:,
|
||||
|
@ -340,11 +340,8 @@ module PyPI
|
||||
show_info = !print_only && !silent
|
||||
ohai "Retrieving PyPI dependencies for \"#{input_packages.join(" ")}\"..." if show_info
|
||||
|
||||
print_stderr = if verbose && show_info
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
print_stderr = verbose && show_info
|
||||
print_stderr ||= false
|
||||
|
||||
found_packages = pip_report(input_packages, python_name:, print_stderr:)
|
||||
# Resolve the dependency tree of excluded packages to prune the above
|
||||
|
Loading…
x
Reference in New Issue
Block a user