Class: RuboCop::Cop::Cask::HomepageMatchesUrl

Inherits:
RuboCop::Cop
  • Object
show all
Extended by:
Forwardable
Includes:
CaskHelp
Defined in:
lib/rubocop/cop/cask/homepage_matches_url.rb

Overview

This cop checks that a cask’s homepage matches the download url, or if it doesn’t, checks if a comment in the form ‘# example.com was verified as official when first introduced to the cask` is present.

Constant Summary collapse

MSG_NO_MATCH =
'`%s` does not match `%s`'.freeze
MSG_MISSING =
'`%s` does not match `%s`, a comment in the form of ' \
'`# %s was verified as official when first ' \
'introduced to the cask` has to be added above the ' \
'`url` stanza'.freeze
MSG_UNNECESSARY =
'`%s` matches `%s`, the comment above the `url` ' \
'stanza is unnecessary'.freeze

Instance Method Summary collapse

Methods included from CaskHelp

#on_block

Instance Method Details

#on_cask(cask_block) ⇒ Object



25
26
27
28
# File 'lib/rubocop/cop/cask/homepage_matches_url.rb', line 25

def on_cask(cask_block)
  @cask_block = cask_block
  add_offenses
end