- 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!
- check the version of `/usr/bin/ld` for support of `-no_fixup_chains`
- check for usage of the `-fuse-ld` flag, since this flag is only
supported by Apple ld64
Also, call `no_fixup_chains` when setting up the build environment.
- 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.
- `Include` and `Exclude` are ubiquitous but `AllowedMethods` less so.
- Move the inheritance to the single cop configuration that it's used
in. Like we do with some other cop configs where they have default
paths/settings that we want to add to, not replace.
- Part of trying to reduce the number of `Excludes:` we have in our
RuboCop configs.
- The fixes here all seemed reasonable, with some minimal tweaks for
line length and less floatiness. Apart from `test/dev-cmd/bottle_spec.rb`
where RuboCop wanted to do some ridiculously floaty indentation and there
wasn't an obvious alternative place to break the lines, so I opted for
in-line disables instead.