- Extended by:
- Defined in:
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
Constant Summary collapse
- REFERENCE_URL =
"https://github.com/Homebrew/homebrew-cask/blob/HEAD/doc/" \ "cask_language_reference/stanzas/url.md#when-url-and-homepage-hostnames-differ-add-a-comment"
- COMMENT_FORMAT =
/# [^ ]+ was verified as official when first introduced to the cask/.freeze
- MSG_NO_MATCH =
"`%<url>s` does not match `%<full_url>s`"
- MSG_MISSING =
("`%<domain>s` does not match `%<homepage>s`, a comment has to be added " \ "above the `url` stanza. For details, see " + ).freeze
- MSG_WRONG_FORMAT =
("`%<comment>s` does not match the expected comment format. " \ "For details, see " + ).freeze
- MSG_UNNECESSARY =
"The URL's domain `%<domain>s` matches the homepage `%<homepage>s`, " \ "the comment above the `url` stanza is unnecessary"
Instance Method Summary collapse
Methods included from
Instance Method Details
#on_cask(cask_block) ⇒ Object
34 35 36 37 38 39
# File 'Library/Homebrew/rubocops/cask/homepage_matches_url.rb', line 34 def on_cask(cask_block) @cask_block = cask_block return unless homepage_stanza add_offenses end