aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/rubocops
diff options
context:
space:
mode:
authorGautham Goli2017-07-15 13:34:16 +0530
committerGautham Goli2017-07-15 17:35:10 +0530
commita8f1b02be936f31d6beedbafae38b063f9085486 (patch)
tree6c223401e0ba45fca1b624ddc992a4cfcdc9a7a2 /Library/Homebrew/rubocops
parent83f61830f6346e2a08358a4ca5381b5ffac4fc6e (diff)
downloadbrew-a8f1b02be936f31d6beedbafae38b063f9085486.tar.bz2
audit: Port audit_options rules for new formulae to rubocop and add test
Diffstat (limited to 'Library/Homebrew/rubocops')
-rw-r--r--Library/Homebrew/rubocops/options_cop.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/rubocops/options_cop.rb b/Library/Homebrew/rubocops/options_cop.rb
index eb2a837be..c16244161 100644
--- a/Library/Homebrew/rubocops/options_cop.rb
+++ b/Library/Homebrew/rubocops/options_cop.rb
@@ -43,5 +43,16 @@ module RuboCop
end
end
end
+
+ module NewFormulaAudit
+ class Options < FormulaCop
+ MSG = "New Formula should not use `deprecated_option`".freeze
+
+ def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if versioned_formula?
+ problem MSG if method_called_ever?(body_node, :deprecated_option)
+ end
+ end
+ end
end
end