mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Enable all Performance Cops
This commit is contained in:
parent
f7e1e58dcb
commit
b9a4fccafa
5 changed files with 6 additions and 42 deletions
40
.rubocop.yml
40
.rubocop.yml
|
@ -1,6 +1,6 @@
|
||||||
AllCops:
|
AllCops:
|
||||||
DisabledByDefault: true
|
DisabledByDefault: true
|
||||||
TargetRubyVersion: 1.9.3
|
TargetRubyVersion: 2.2
|
||||||
DisplayCopNames: true
|
DisplayCopNames: true
|
||||||
StyleGuideCopsOnly: false
|
StyleGuideCopsOnly: false
|
||||||
Exclude:
|
Exclude:
|
||||||
|
@ -51,41 +51,5 @@ Style/MethodDefParentheses:
|
||||||
Style/TrailingCommaInArguments:
|
Style/TrailingCommaInArguments:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Performance/Count:
|
Performance:
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Performance/Detect:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Performance/EndWith:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Performance/FlatMap:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Performance/HashEachMethods:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Performance/RangeInclude:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Performance/RedundantMerge:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Performance/RedundantSortBy:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Performance/ReverseEach:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Performance/Sample:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Performance/Size:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Performance/StartWith:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Performance/TimesMap:
|
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
|
@ -493,7 +493,7 @@ module Puma
|
||||||
when Hash
|
when Hash
|
||||||
if hdr = val[:header]
|
if hdr = val[:header]
|
||||||
@options[:remote_address] = :header
|
@options[:remote_address] = :header
|
||||||
@options[:remote_address_header] = "HTTP_" + hdr.upcase.gsub("-", "_")
|
@options[:remote_address_header] = "HTTP_" + hdr.upcase.tr("-", "_")
|
||||||
else
|
else
|
||||||
raise "Invalid value for set_remote_address - #{val.inspect}"
|
raise "Invalid value for set_remote_address - #{val.inspect}"
|
||||||
end
|
end
|
||||||
|
|
|
@ -110,7 +110,7 @@ module Puma::Rack
|
||||||
|
|
||||||
has_options = false
|
has_options = false
|
||||||
server.valid_options.each do |name, description|
|
server.valid_options.each do |name, description|
|
||||||
next if name.to_s.match(/^(Host|Port)[^a-zA-Z]/) # ignore handler's host and port options, we do our own.
|
next if name.to_s =~ /^(Host|Port)[^a-zA-Z]/ # ignore handler's host and port options, we do our own.
|
||||||
info << " -O %-21s %s" % [name, description]
|
info << " -O %-21s %s" % [name, description]
|
||||||
has_options = true
|
has_options = true
|
||||||
end
|
end
|
||||||
|
|
|
@ -181,7 +181,7 @@ class TestIntegration < Minitest::Test
|
||||||
until done
|
until done
|
||||||
@events.stdout.rewind
|
@events.stdout.rewind
|
||||||
log = @events.stdout.readlines.join("")
|
log = @events.stdout.readlines.join("")
|
||||||
if log.match(/- Worker \d \(pid: \d+\) booted, phase: 1/)
|
if log =~ /- Worker \d \(pid: \d+\) booted, phase: 1/
|
||||||
assert_match(/TERM sent/, log)
|
assert_match(/TERM sent/, log)
|
||||||
assert_match(/- Worker \d \(pid: \d+\) booted, phase: 1/, log)
|
assert_match(/- Worker \d \(pid: \d+\) booted, phase: 1/, log)
|
||||||
done = true
|
done = true
|
||||||
|
|
|
@ -144,7 +144,7 @@ class TestPumaServerSSLClient < Minitest::Test
|
||||||
http.use_ssl = true
|
http.use_ssl = true
|
||||||
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
||||||
|
|
||||||
blk.call(http)
|
yield(http)
|
||||||
|
|
||||||
client_error = false
|
client_error = false
|
||||||
begin
|
begin
|
||||||
|
|
Loading…
Add table
Reference in a new issue