mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00

- I suspect these were copy-pasted from other cops, like I did in https://github.com/Homebrew/brew/pull/14886#discussion_r1125569999. - The "forwardable" require is unnecesary if the cop doesn't `extend Forwardable` and use `def_delegator`. - The "uri" require is unnecessary if the cop doesn't call `URI` methods.
26 lines
596 B
Ruby
26 lines
596 B
Ruby
# typed: true
|
|
# frozen_string_literal: true
|
|
|
|
require "rubocops/cask/mixin/on_desc_stanza"
|
|
require "rubocops/shared/desc_helper"
|
|
|
|
module RuboCop
|
|
module Cop
|
|
module Cask
|
|
# This cop audits `desc` in casks.
|
|
# See the {DescHelper} module for details of the checks.
|
|
class Desc < Base
|
|
include OnDescStanza
|
|
include DescHelper
|
|
extend AutoCorrector
|
|
|
|
def on_desc_stanza(stanza)
|
|
@name = cask_block.header.cask_token
|
|
desc_call = stanza.stanza_node
|
|
audit_desc(:cask, @name, desc_call)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|