1
0
Fork 0
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:
schneems 2018-07-30 21:30:32 -05:00
parent f7e1e58dcb
commit b9a4fccafa
5 changed files with 6 additions and 42 deletions

View file

@ -1,6 +1,6 @@
AllCops:
DisabledByDefault: true
TargetRubyVersion: 1.9.3
TargetRubyVersion: 2.2
DisplayCopNames: true
StyleGuideCopsOnly: false
Exclude:
@ -51,41 +51,5 @@ Style/MethodDefParentheses:
Style/TrailingCommaInArguments:
Enabled: true
Performance/Count:
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:
Performance:
Enabled: true

View file

@ -493,7 +493,7 @@ module Puma
when Hash
if hdr = val[:header]
@options[:remote_address] = :header
@options[:remote_address_header] = "HTTP_" + hdr.upcase.gsub("-", "_")
@options[:remote_address_header] = "HTTP_" + hdr.upcase.tr("-", "_")
else
raise "Invalid value for set_remote_address - #{val.inspect}"
end

View file

@ -110,7 +110,7 @@ module Puma::Rack
has_options = false
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]
has_options = true
end

View file

@ -181,7 +181,7 @@ class TestIntegration < Minitest::Test
until done
@events.stdout.rewind
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(/- Worker \d \(pid: \d+\) booted, phase: 1/, log)
done = true

View file

@ -144,7 +144,7 @@ class TestPumaServerSSLClient < Minitest::Test
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
blk.call(http)
yield(http)
client_error = false
begin