Autofix Rubocop Style/IfUnlessModifier (#23697)

This commit is contained in:
Nick Schonning
2023-02-18 06:37:47 -05:00
committed by GitHub
parent 9ab2a775c9
commit e2a3ebb271
40 changed files with 55 additions and 271 deletions

View File

@ -27,9 +27,7 @@ class ActivityPub::LinkedDataSignature
document_hash = hash(@json.without('signature'))
to_be_verified = options_hash + document_hash
if creator.keypair.public_key.verify(OpenSSL::Digest.new('SHA256'), Base64.decode64(signature), to_be_verified)
creator
end
creator if creator.keypair.public_key.verify(OpenSSL::Digest.new('SHA256'), Base64.decode64(signature), to_be_verified)
end
def sign!(creator, sign_with: nil)

View File

@ -50,9 +50,7 @@ class ActivityPub::Parser::MediaAttachmentParser
components = begin
blurhash = @json['blurhash']
if blurhash.present? && /^[\w#$%*+,-.:;=?@\[\]^{|}~]+$/.match?(blurhash)
Blurhash.components(blurhash)
end
Blurhash.components(blurhash) if blurhash.present? && /^[\w#$%*+,-.:;=?@\[\]^{|}~]+$/.match?(blurhash)
end
components.present? && components.none? { |comp| comp > 5 }

View File

@ -27,8 +27,6 @@ class StatusFinder
end
def verify_action!
unless recognized_params[:action] == 'show'
raise ActiveRecord::RecordNotFound
end
raise ActiveRecord::RecordNotFound unless recognized_params[:action] == 'show'
end
end