Document FormulaAudit::Caveats.
This commit is contained in:
parent
07365b9ad0
commit
a91e606d48
@ -5,6 +5,24 @@ require "rubocops/extend/formula"
|
|||||||
module RuboCop
|
module RuboCop
|
||||||
module Cop
|
module Cop
|
||||||
module FormulaAudit
|
module FormulaAudit
|
||||||
|
# This cop makes sure that caveats don't recommend unsupported or unsafe operations.
|
||||||
|
#
|
||||||
|
# @example
|
||||||
|
# # bad
|
||||||
|
# def caveats
|
||||||
|
# <<~EOS
|
||||||
|
# Use `setuid` to allow running the exeutable by non-root users.
|
||||||
|
# EOS
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# # good
|
||||||
|
# def caveats
|
||||||
|
# <<~EOS
|
||||||
|
# Use `sudo` to run the executable.
|
||||||
|
# EOS
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class Caveats < FormulaCop
|
class Caveats < FormulaCop
|
||||||
def audit_formula(_node, _class_node, _parent_class_node, _body_node)
|
def audit_formula(_node, _class_node, _parent_class_node, _body_node)
|
||||||
caveats_strings.each do |n|
|
caveats_strings.each do |n|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user