Skip to content

Commit

Permalink
Add Rubocop for redundant returns
Browse files Browse the repository at this point in the history
  • Loading branch information
nateberkopec authored and JuanitoFatas committed Sep 9, 2022
1 parent 0b6d8d2 commit 4133565
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,6 @@ Style/WhileUntilModifier:

Style/TernaryParentheses:
Enabled: true

Style/RedundantReturn:
Enabled: true
2 changes: 1 addition & 1 deletion lib/puma/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def setup_body

@body_remain = remain

return false
false
end

def read_body
Expand Down
2 changes: 1 addition & 1 deletion lib/puma/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def self.extract_name(ary)
path = ary.first[CALLER_FILE]

m = %r!puma/plugin/([^/]*)\.rb$!.match(path)
return m[1]
m[1]
end

def self.create(&blk)
Expand Down
2 changes: 1 addition & 1 deletion lib/puma/rack/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def self.parse_file(config, opts = Options.new)
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)")
Expand Down
2 changes: 1 addition & 1 deletion lib/puma/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def handle_request(client, lines, requests)
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
Expand Down
2 changes: 1 addition & 1 deletion lib/puma/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def handle_check
return true
end

return false
false
end

# Given a connection on +client+, handle the incoming requests,
Expand Down
2 changes: 1 addition & 1 deletion lib/puma/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def parse_query(qs, d = nil, &unescaper)
end
end

return params
params
end

# A case-insensitive Hash that preserves the original case of a
Expand Down
2 changes: 1 addition & 1 deletion test/test_http11.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def rand_data(min, max, readable=true)
res << Digest::SHA1.digest(rand(count * 100).to_s) * (count / 20)
end

return res
res
end

def test_max_uri_path_length
Expand Down

0 comments on commit 4133565

Please sign in to comment.