mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
improved rubocop config (#2152)
This commit is contained in:
parent
27ed7b1dc1
commit
2cef8ddae1
7 changed files with 29 additions and 38 deletions
23
.rubocop.yml
23
.rubocop.yml
|
@ -6,6 +6,8 @@ AllCops:
|
|||
Exclude:
|
||||
- 'tmp/**/*'
|
||||
- 'vendor/**/*'
|
||||
- 'examples/**/*'
|
||||
- 'pkg/**/*'
|
||||
- 'Rakefile'
|
||||
|
||||
Layout/SpaceAfterColon:
|
||||
|
@ -53,3 +55,24 @@ Style/TrailingCommaInArguments:
|
|||
|
||||
Performance:
|
||||
Enabled: true
|
||||
|
||||
Metrics/ParameterLists:
|
||||
Max: 7
|
||||
|
||||
Performance/RedundantMatch:
|
||||
Enabled: true
|
||||
|
||||
Performance/RedundantBlockCall:
|
||||
Enabled: true
|
||||
|
||||
Performance/StringReplacement:
|
||||
Enabled: true
|
||||
|
||||
Layout/AccessModifierIndentation:
|
||||
EnforcedStyle: indent
|
||||
|
||||
Style/WhileUntilModifier:
|
||||
Enabled: true
|
||||
|
||||
Style/TernaryParentheses:
|
||||
Enabled: true
|
||||
|
|
|
@ -39,19 +39,7 @@ Layout/EmptyLinesAroundModuleBody:
|
|||
# 5 offenses
|
||||
Layout/IndentationWidth:
|
||||
Enabled: true
|
||||
|
||||
# 3 offenses
|
||||
Layout/AccessModifierIndentation:
|
||||
EnforcedStyle: indent
|
||||
|
||||
# 2 offenses
|
||||
Style/WhileUntilModifier:
|
||||
Enabled: true
|
||||
|
||||
# 1 offense
|
||||
Style/TernaryParentheses:
|
||||
Enabled: true
|
||||
|
||||
|
||||
# >200 offenses for 80
|
||||
# 58 offenses for 100
|
||||
# 18 offenses for 120
|
||||
|
@ -64,19 +52,3 @@ Metrics/LineLength:
|
|||
- https
|
||||
IgnoreCopDirectives: false
|
||||
IgnoredPatterns: []
|
||||
|
||||
# 1 offense
|
||||
Metrics/ParameterLists:
|
||||
Max: 5
|
||||
|
||||
# 1 offense
|
||||
Performance/RedundantMatch:
|
||||
Enabled: true
|
||||
|
||||
# 1 offense
|
||||
Performance/RedundantBlockCall:
|
||||
Enabled: true
|
||||
|
||||
# 1 offense
|
||||
Performance/StringReplacement:
|
||||
Enabled: true
|
|
@ -80,7 +80,7 @@ module Puma
|
|||
@launcher.run
|
||||
end
|
||||
|
||||
private
|
||||
private
|
||||
def unsupported(str)
|
||||
@events.error(str)
|
||||
raise UnsupportedOption
|
||||
|
|
|
@ -263,7 +263,7 @@ module Puma
|
|||
exit 1
|
||||
end
|
||||
|
||||
private
|
||||
private
|
||||
def start
|
||||
require 'puma/cli'
|
||||
|
||||
|
|
|
@ -141,9 +141,7 @@ module Puma
|
|||
# Read any drop any partially initialized sockets and any received bytes during shutdown.
|
||||
# Don't let this socket hold this loop forever.
|
||||
# If it can't send more packets within 1s, then give up.
|
||||
while should_drop_bytes?
|
||||
return if [:timeout, :eof].include?(read_and_drop(1))
|
||||
end
|
||||
return if [:timeout, :eof].include?(read_and_drop(1)) while should_drop_bytes?
|
||||
rescue IOError, SystemCallError
|
||||
Thread.current.purge_interrupt_queue if Thread.current.respond_to? :purge_interrupt_queue
|
||||
# nothing
|
||||
|
|
|
@ -15,7 +15,7 @@ module Puma
|
|||
# Mimics IO#read with no data.
|
||||
#
|
||||
def read(count = nil, _buffer = nil)
|
||||
(count && count > 0) ? nil : ""
|
||||
count && count > 0 ? nil : ""
|
||||
end
|
||||
|
||||
def rewind
|
||||
|
|
|
@ -33,9 +33,7 @@ class TestPathHandler < Minitest::Test
|
|||
|
||||
# Wait for launcher to boot
|
||||
Timeout.timeout(10) do
|
||||
until @launcher
|
||||
sleep 1
|
||||
end
|
||||
sleep 1 until @launcher
|
||||
end
|
||||
sleep 1
|
||||
|
||||
|
|
Loading…
Reference in a new issue