2
0

Fix Style/OptionalBooleanParameter cop (#34968)

This commit is contained in:
Matt Jankowski
2025-06-10 04:17:35 -04:00
committed by GitHub
parent a2a6117143
commit dc2cfd50a0
14 changed files with 17 additions and 29 deletions

View File

@@ -13,7 +13,7 @@ class Admin::SystemCheck::MediaPrivacyCheck < Admin::SystemCheck::BaseCheck
end
def message
Admin::SystemCheck::Message.new(@failure_message, @failure_value, @failure_action, true)
Admin::SystemCheck::Message.new(@failure_message, @failure_value, @failure_action, critical: true)
end
private

View File

@@ -3,7 +3,7 @@
class Admin::SystemCheck::Message
attr_reader :key, :value, :action, :critical
def initialize(key, value = nil, action = nil, critical = false)
def initialize(key, value = nil, action = nil, critical: false)
@key = key
@value = value
@action = action

View File

@@ -13,7 +13,7 @@ class Admin::SystemCheck::SoftwareVersionCheck < Admin::SystemCheck::BaseCheck
def message
if software_updates.any?(&:urgent?)
Admin::SystemCheck::Message.new(:software_version_critical_check, nil, admin_software_updates_path, true)
Admin::SystemCheck::Message.new(:software_version_critical_check, nil, admin_software_updates_path, critical: true)
elsif software_updates.any?(&:patch_type?)
Admin::SystemCheck::Message.new(:software_version_patch_check, nil, admin_software_updates_path)
else

View File

@@ -20,7 +20,7 @@ class PerOperationWithDeadline < HTTP::Timeout::PerOperation
@read_deadline = options.fetch(:read_deadline, READ_DEADLINE)
end
def connect(socket_class, host, port, nodelay = false)
def connect(socket_class, host, port, nodelay = false) # rubocop:disable Style/OptionalBooleanParameter
@socket = socket_class.open(host, port)
@socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) if nodelay
end

View File

@@ -65,7 +65,7 @@ class Webfinger
private
def body_from_webfinger(url = standard_url, use_fallback = true)
def body_from_webfinger(url = standard_url, use_fallback: true)
webfinger_request(url).perform do |res|
if res.code == 200
body = res.body_with_limit
@@ -85,7 +85,7 @@ class Webfinger
def body_from_host_meta
host_meta_request.perform do |res|
if res.code == 200
body_from_webfinger(url_from_template(res.body_with_limit), false)
body_from_webfinger(url_from_template(res.body_with_limit), use_fallback: false)
else
raise Webfinger::Error, "Request for #{@uri} returned HTTP #{res.code}"
end