From e8b82bbe1e45cbf3d2db60d9980f4713e0eddf17 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 13 Aug 2021 13:49:52 +0100 Subject: [PATCH] Fix `brew style` --- Library/Homebrew/cli/parser.rb | 6 +----- Library/Homebrew/formula.rb | 2 +- Library/Homebrew/sandbox.rb | 18 +++++++++--------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Library/Homebrew/cli/parser.rb b/Library/Homebrew/cli/parser.rb index a4b536d619..e4ce0c784b 100644 --- a/Library/Homebrew/cli/parser.rb +++ b/Library/Homebrew/cli/parser.rb @@ -161,11 +161,7 @@ module Homebrew end @parser.public_send(method, *names, *wrap_option_desc(description)) do |value| odisabled "the `#{names.first}` switch", replacement unless replacement.nil? - value = if names.any? { |name| name.start_with?("--[no-]") } - value - else - true - end + value = true if names.none? { |name| name.start_with?("--[no-]") } set_switch(*names, value: value, from: :args) end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 80889b021f..ad42a80aee 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -2002,7 +2002,7 @@ class Formula bottle_spec.collector.each_key do |os| collector_os = bottle_spec.collector[os] os_cellar = collector_os[:cellar] - os_cellar = os_cellar.is_a?(Symbol) ? os_cellar.inspect : os_cellar + os_cellar = os_cellar.inspect if os_cellar.is_a?(Symbol) checksum = collector_os[:checksum].hexdigest filename = Bottle::Filename.create(self, os, bottle_spec.rebuild) diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb index 56486ac9a7..79c2e5d3f5 100644 --- a/Library/Homebrew/sandbox.rb +++ b/Library/Homebrew/sandbox.rb @@ -103,15 +103,15 @@ class Sandbox ensure seatbelt.unlink sleep 0.1 # wait for a bit to let syslog catch up the latest events. - syslog_args = %W[ - -F $((Time)(local))\ $(Sender)[$(PID)]:\ $(Message) - -k Time ge #{@start.to_i} - -k Message S deny - -k Sender kernel - -o - -k Time ge #{@start.to_i} - -k Message S deny - -k Sender sandboxd + syslog_args = [ + "-F", "$((Time)(local)) $(Sender)[$(PID)]: $(Message)", + "-k", "Time", "ge", @start.to_i.to_s, + "-k", "Message", "S", "deny", + "-k", "Sender", "kernel", + "-o", + "-k", "Time", "ge", @start.to_i.to_s, + "-k", "Message", "S", "deny", + "-k", "Sender", "sandboxd" ] logs = Utils.popen_read("syslog", *syslog_args)