Class: RuboCop::Cop::Cask::Desc

Inherits:
RuboCop::Cop show all
Includes:
OnDescStanza, DescHelper
Defined in:
brew/Library/Homebrew/rubocops/cask/desc.rb

Overview

This cop audits desc in Casks. See the DescHelper module for details of the checks.

Constant Summary

Constants included from DescHelper

DescHelper::MAX_DESC_LENGTH, DescHelper::VALID_LOWERCASE_WORDS

Instance Method Summary collapse

Methods included from DescHelper

#audit_desc, #autocorrect_desc

Methods included from HelperFunctions

#line_number, #line_start_column, #problem, #regex_match_group, #source_buffer, #start_column, #string_content

Methods included from OnDescStanza

#on_cask

Methods included from CaskHelp

#on_block

Instance Method Details

#autocorrect(node) ⇒ Object



23
24
25
26
# File 'brew/Library/Homebrew/rubocops/cask/desc.rb', line 23

def autocorrect(node)
  name = cask_block.header.cask_token
  autocorrect_desc(node, name)
end

#on_desc_stanza(stanza) ⇒ Object



17
18
19
20
21
# File 'brew/Library/Homebrew/rubocops/cask/desc.rb', line 17

def on_desc_stanza(stanza)
  name = cask_block.header.cask_token
  desc_call = stanza.stanza_node
  audit_desc(:cask, name, desc_call)
end