Skip to content
Snippets Groups Projects
Verified Commit a7cced2f authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Fix Rubocop issues

parent e3aab27e
Branches
No related tags found
No related merge requests found
Pipeline #2601 passed
...@@ -8,6 +8,9 @@ AllCops: ...@@ -8,6 +8,9 @@ AllCops:
Lint/Void: Lint/Void:
Enabled: false Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
# Don't enforce documentation # Don't enforce documentation
Style/Documentation: Style/Documentation:
Enabled: false Enabled: false
...@@ -18,6 +21,10 @@ Metrics/ClassLength: ...@@ -18,6 +21,10 @@ Metrics/ClassLength:
Metrics/MethodLength: Metrics/MethodLength:
Max: 50 Max: 50
# Matrix has a lot of methods in the CS API
Metrics/ModuleLength:
Max: 500
Metrics/LineLength: Metrics/LineLength:
Max: 190 Max: 190
......
...@@ -42,7 +42,7 @@ module MatrixSdk ...@@ -42,7 +42,7 @@ module MatrixSdk
@protocols = params.fetch(:protocols, %i[CS]) @protocols = params.fetch(:protocols, %i[CS])
@protocols = [@protocols] unless @protocols.is_a? Array @protocols = [@protocols] unless @protocols.is_a? Array
@protocols << :CS if @protocols.include?(:AS) && !@protocols.include?(:CS) @protocols << :CS if @protocols.include?(:AS) && !@protocols.include?(:CS)
@protocols.sort.reverse.each do |prot| @protocols.sort.reverse_each do |prot|
extend MatrixSdk::Protocols.const_get(prot) extend MatrixSdk::Protocols.const_get(prot)
end end
......
...@@ -58,6 +58,7 @@ module MatrixSdk ...@@ -58,6 +58,7 @@ module MatrixSdk
def port=(port) def port=(port)
raise ArgumentError, 'Port must be a number' unless port.is_a? Numeric raise ArgumentError, 'Port must be a number' unless port.is_a? Numeric
@port = port @port = port
end end
...@@ -66,6 +67,7 @@ module MatrixSdk ...@@ -66,6 +67,7 @@ module MatrixSdk
def add_method(method, regex, proc = nil, &block) def add_method(method, regex, proc = nil, &block)
proc ||= block proc ||= block
raise ArgumentError, 'No method specified' if proc.nil? raise ArgumentError, 'No method specified' if proc.nil?
(@method_map[method] ||= {})[regex] = proc (@method_map[method] ||= {})[regex] = proc
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment