1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Add Rubocop for redundant returns

This commit is contained in:
Nate Berkopec 2021-06-10 12:28:35 -06:00
parent 0256d71e60
commit f418a6809a
No known key found for this signature in database
GPG key ID: 19616755F4328D71
8 changed files with 10 additions and 7 deletions

View file

@ -76,3 +76,6 @@ Style/WhileUntilModifier:
Style/TernaryParentheses: Style/TernaryParentheses:
Enabled: true Enabled: true
Style/RedundantReturn:
Enabled: true

View file

@ -309,7 +309,7 @@ module Puma
@body_remain = remain @body_remain = remain
return false false
end end
def read_body def read_body

View file

@ -91,7 +91,7 @@ module Puma
path = ary.first[CALLER_FILE] path = ary.first[CALLER_FILE]
m = %r!puma/plugin/([^/]*)\.rb$!.match(path) m = %r!puma/plugin/([^/]*)\.rb$!.match(path)
return m[1] m[1]
end end
def self.create(&blk) def self.create(&blk)

View file

@ -165,7 +165,7 @@ module Puma::Rack
require config require config
app = Object.const_get(::File.basename(config, '.rb').capitalize) app = Object.const_get(::File.basename(config, '.rb').capitalize)
end end
return app, options [app, options]
end end
def self.new_from_string(builder_script, file="(rackup)") def self.new_from_string(builder_script, file="(rackup)")

View file

@ -176,7 +176,7 @@ module Puma
after_reply.each { |o| o.call } after_reply.each { |o| o.call }
end end
return res_info[:keep_alive] res_info[:keep_alive]
end end
# @param env [Hash] see Puma::Client#env, from request # @param env [Hash] see Puma::Client#env, from request

View file

@ -396,7 +396,7 @@ module Puma
return true return true
end end
return false false
end end
# Given a connection on +client+, handle the incoming requests, # Given a connection on +client+, handle the incoming requests,

View file

@ -61,7 +61,7 @@ module Puma
end end
end end
return params params
end end
# A case-insensitive Hash that preserves the original case of a # A case-insensitive Hash that preserves the original case of a

View file

@ -137,7 +137,7 @@ class Http11ParserTest < Minitest::Test
res << Digest::SHA1.digest(rand(count * 100).to_s) * (count / 20) res << Digest::SHA1.digest(rand(count * 100).to_s) * (count / 20)
end end
return res res
end end
def test_max_uri_path_length def test_max_uri_path_length