style: enable Style/ParallelAssignment cop checks

This commit is contained in:
Gonzalo Rodriguez 2019-08-02 13:47:54 -03:00
parent 9d2e66e4eb
commit c0328707b1
No known key found for this signature in database
GPG key ID: 5DB8B81B049B8AB1
4 changed files with 11 additions and 3 deletions

View file

@ -67,6 +67,9 @@ Style/HashSyntax:
Style/OptionalArguments:
Enabled: true
Style/ParallelAssignment:
Enabled: true
Style/RaiseArgs:
Enabled: true

View file

@ -119,7 +119,10 @@ module Rack
end
def clear_configuration
@safelists, @blocklists, @throttles, @tracks = {}, {}, {}, {}
@safelists = {}
@blocklists = {}
@throttles = {}
@tracks = {}
self.anonymous_blocklists = []
self.anonymous_safelists = []
end

View file

@ -5,7 +5,8 @@ module Rack
class Check
attr_reader :name, :block, :type
def initialize(name, options = {}, &block)
@name, @block = name, block
@name = name
@block = block
@type = options.fetch(:type, nil)
end

View file

@ -7,7 +7,8 @@ module Rack
attr_reader :name, :limit, :period, :block, :type
def initialize(name, options, &block)
@name, @block = name, block
@name = name
@block = block
MANDATORY_OPTIONS.each do |opt|
raise ArgumentError, "Must pass #{opt.inspect} option" unless options[opt]
end