mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 16:59:41 +00:00
Fix Style/OptionalBooleanParameter cop (#34968)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user