- 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.
I forgot to add the new `Json`, `Xml`, and `Yaml` strategies to the
list of strategies where `#preprocess_url` should be skipped and this
was causing issues for a user in their tap. This is unfortunately
another bug that wasn't surfaced when I tested all the related checks
in our first-party taps.
- The usage of this in `brew contributions` wasn't correct for a user
with 5 authored commits to homebrew/cask that had been committed by
other people, the numbers would turn out as 5 authored, 5 committed.
- I decided to do this properly by getting the SHAs for author and
committer and determine the differences between the two arrays.
This also accounts for when authored commits are 0, or committed
commits, or both.
- Add tests, because I don't want to fix this a third time!
- 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 had a lot of offenses that were marked as "try to enable".
- A lot of the "describe class" ones were for tests for cmds or dev-cmds,
`brew typecheck` or `brew --env`, and the cop would only pass if I
changed these "describe"s to `BrewTypecheck` or `Brew__Env` which
seemed unhelpful.
- The usefulness of the stubbed mocks cop is
[disputed](https://github.com/rubocop/rubocop-rspec/issues/ 1271), and
fixing the offenses (not autocorrectable) would involve us doing a
fair number of changes since changing `expect` to `allow` would then
force us to make each of the affected tests have `expect` assertions
at the end, where they sometimes don't currently.
- Other occurrences of `@@` and `$` variables are individually disabled
in-line in other files.
- So let's follow the same pattern for Homebrew/homebrew-cask developer
scripts, since there are only a few.