- I needed to add some more `require`s to the `tty.rb` generator script
since it failed to recognise `env_config` and Sorbet's `T` setup if I
ran it not via `brew ruby`, and I couldn't get `brew ruby` to work
within `safe_system` in the `typecheck` dev-cmd.
- Sort of. It's not via Parlour, because I read the docs and all it says
about dynamically generating things is "of course it's better to do
that", no examples. I tried my best, but Bo's work on `attr.rb` was
mind-boggling.
- Instead, let's add a simple but functional generator script that I
actually understand, as an alternative to maintaining these RBI files
for dynamic methods manually, so that we can get rid of some use of
`srb rbi hidden-definitions` since that's deprecated.
- TODO: Run this script as part of `brew typecheck --update` so it gets
updated with all the other RBI files periodically.
- Follow up to PR 14651.
- 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.