aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/rubocops/extend
diff options
context:
space:
mode:
authorGautham Goli2017-06-01 00:57:24 +0530
committerGautham Goli2017-06-08 21:53:46 +0530
commitd09d5ecc559c4971fae77769cb1a203bb20c7a97 (patch)
treef7fff3a14cf6c6fdaa9ec0996c18af7ed16c41e0 /Library/Homebrew/rubocops/extend
parent134da5b8c266d0e5f07a1f79bff233f372c7ef30 (diff)
downloadbrew-d09d5ecc559c4971fae77769cb1a203bb20c7a97.tar.bz2
audit: Port audit_checksum method to rubocop and add tests
Diffstat (limited to 'Library/Homebrew/rubocops/extend')
-rw-r--r--Library/Homebrew/rubocops/extend/formula_cop.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/Library/Homebrew/rubocops/extend/formula_cop.rb b/Library/Homebrew/rubocops/extend/formula_cop.rb
index 6bb406c05..b6fa45d3f 100644
--- a/Library/Homebrew/rubocops/extend/formula_cop.rb
+++ b/Library/Homebrew/rubocops/extend/formula_cop.rb
@@ -176,7 +176,7 @@ module RuboCop
# Returns an array of block nodes of any depth below node in AST
def find_all_blocks(node, block_name)
return if node.nil?
- node.each_descendant(:block).select { |block_node| block_name == block_node.method_name}
+ node.each_descendant(:block).select { |block_node| block_name == block_node.method_name }
end
# Returns a method definition node with method_name
@@ -256,8 +256,7 @@ module RuboCop
# Returns the array of arguments of the method_node
def parameters(method_node)
- return unless method_node.send_type? || method_node.block_type?
- method_node.method_args
+ method_node.method_args if method_node.send_type? || method_node.block_type?
end
# Returns true if the given parameters are present in method call