aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/rubocops/caveats_cop.rb
blob: 3935d563881c7326f5c25adb76a5bea169a40f6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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