diff --git a/.rubocop.yml b/.rubocop.yml index f4e71149..2ed66551 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -76,3 +76,6 @@ Style/WhileUntilModifier: Style/TernaryParentheses: Enabled: true + +Style/RedundantReturn: + Enabled: true diff --git a/lib/puma/client.rb b/lib/puma/client.rb index 8b203376..8ff6c6fb 100644 --- a/lib/puma/client.rb +++ b/lib/puma/client.rb @@ -309,7 +309,7 @@ module Puma @body_remain = remain - return false + false end def read_body diff --git a/lib/puma/plugin.rb b/lib/puma/plugin.rb index 008385c0..eb32f312 100644 --- a/lib/puma/plugin.rb +++ b/lib/puma/plugin.rb @@ -91,7 +91,7 @@ module Puma path = ary.first[CALLER_FILE] m = %r!puma/plugin/([^/]*)\.rb$!.match(path) - return m[1] + m[1] end def self.create(&blk) diff --git a/lib/puma/rack/builder.rb b/lib/puma/rack/builder.rb index cf00d975..2c46cb1e 100644 --- a/lib/puma/rack/builder.rb +++ b/lib/puma/rack/builder.rb @@ -165,7 +165,7 @@ module Puma::Rack require config app = Object.const_get(::File.basename(config, '.rb').capitalize) end - return app, options + [app, options] end def self.new_from_string(builder_script, file="(rackup)") diff --git a/lib/puma/request.rb b/lib/puma/request.rb index 5b7ab228..8912db30 100644 --- a/lib/puma/request.rb +++ b/lib/puma/request.rb @@ -176,7 +176,7 @@ module Puma after_reply.each { |o| o.call } end - return res_info[:keep_alive] + res_info[:keep_alive] end # @param env [Hash] see Puma::Client#env, from request diff --git a/lib/puma/server.rb b/lib/puma/server.rb index bf2dbc4f..e55e95ed 100644 --- a/lib/puma/server.rb +++ b/lib/puma/server.rb @@ -396,7 +396,7 @@ module Puma return true end - return false + false end # Given a connection on +client+, handle the incoming requests, diff --git a/lib/puma/util.rb b/lib/puma/util.rb index c2b3b412..d4928e13 100644 --- a/lib/puma/util.rb +++ b/lib/puma/util.rb @@ -61,7 +61,7 @@ module Puma end end - return params + params end # A case-insensitive Hash that preserves the original case of a diff --git a/test/test_http11.rb b/test/test_http11.rb index 9a1f9d91..9e49b7b3 100644 --- a/test/test_http11.rb +++ b/test/test_http11.rb @@ -137,7 +137,7 @@ class Http11ParserTest < Minitest::Test res << Digest::SHA1.digest(rand(count * 100).to_s) * (count / 20) end - return res + res end def test_max_uri_path_length