- As discussed in
https://github.com/Homebrew/brew/pull/14976#issuecomment-1474544569
and further comments, this is needed because in order to enforce the
order of `on_{arch,system}` blocks we need to have everything
consistently within one of those blocks.
- We previously allowed overrides where the top-level `version` stanza
would be the default, unless on an OS that had an `on_system` block
with a `version` specified. But this breaks down when we try to order
the `on_system` blocks because if a `url` at the top-level has a
`version` interpolated in it, then the `version` stanza needs to be
above the `url` stanza. But it could be that `version` is OS-specific.
- Let's stop allowing overrides and require that everything be in an
`on_system` block. This will make it easier to enforce the order of
`on_system` blocks in a future PR (14976).
- 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.
- The `on_url_stanza` method is now used in two cops, `Url` and
`UrlLegacyCommaSeparators`. Make the latter inherit from the former
to make Sorbet happy.
- The style and typecheck checks now pass fine.
- Apparently the "verified" parameter in the URL (present when a Cask's
download URL is not the same as its homepage) shouldn't have the
protocol (`https`, `http`) at the front.
- Removing this has happened manually in the past, so here's an
autocorrecting RuboCop for it.
- These are arbitrary length limits that had a load of disables in code.
- The limits were only increasing over time rather than decreasing.
- Fixing the problematic code to be shorter would take a long time for
questionable gain since the problem has been around so long.
1. `llvm-g{cc,++}` has been gone for a long time. We don't need to check
for this anymore.
2. Also check for calling the compiler as `cc`, `c89`, `c99`, or `c++`.
Formula caveats text appears on formulae.brew.sh but escape
characters, as used in ANSI escape codes, should not appear in HTML.
This commit adds a RuboCop to disallow escape characters in the
caveats text.
- Change name of rubocop warning
- Disable linting on remaining offending lines
- Add todos to move lines with disabled linting
checks to extend/os in the future