aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/rubocops/caveats_cop.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/rubocops/caveats_cop.rb')
-rw-r--r--Library/Homebrew/rubocops/caveats_cop.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/Library/Homebrew/rubocops/caveats_cop.rb b/Library/Homebrew/rubocops/caveats_cop.rb
new file mode 100644
index 000000000..3935d5638
--- /dev/null
+++ b/Library/Homebrew/rubocops/caveats_cop.rb
@@ -0,0 +1,16 @@
+require_relative "./extend/formula_cop"
+
+module RuboCop
+ module Cop
+ module FormulaAudit
+ class Caveats < FormulaCop
+ def audit_formula(_node, _class_node, _parent_class_node, _body_node)
+ caveats_strings.each do |n|
+ next unless regex_match_group(n, /\bsetuid\b/i)
+ problem "Don't recommend setuid in the caveats, suggest sudo instead."
+ end
+ end
+ end
+ end
+ end
+end