aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/rubocops/extend
diff options
context:
space:
mode:
authorGautham Goli2017-08-14 02:18:46 +0530
committerGautham Goli2017-08-14 02:18:46 +0530
commit3efba57cd936f1e53b72a9e66561d594fcf37d65 (patch)
tree4aaecdf7dd83e96947c91099e7849f0018618828 /Library/Homebrew/rubocops/extend
parente14fedd1b35480ea3707689db044140d18662b9c (diff)
downloadbrew-3efba57cd936f1e53b72a9e66561d594fcf37d65.tar.bz2
Add negated? method to formula cop and add tests for negated build.without?
Diffstat (limited to 'Library/Homebrew/rubocops/extend')
-rw-r--r--Library/Homebrew/rubocops/extend/formula_cop.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/rubocops/extend/formula_cop.rb b/Library/Homebrew/rubocops/extend/formula_cop.rb
index 94952d1f5..862dabfda 100644
--- a/Library/Homebrew/rubocops/extend/formula_cop.rb
+++ b/Library/Homebrew/rubocops/extend/formula_cop.rb
@@ -297,6 +297,11 @@ module RuboCop
true
end
+ # Check if negation is present in the given node
+ def negated?(node)
+ method_called?(node, :!)
+ end
+
# Return all the caveats' string nodes in an array
def caveats_strings
find_strings(find_method_def(@body, :caveats))