23290 Commits

Author SHA1 Message Date
Sam Ford
f2bd39ccef
Add additional method signatures to strategies 2021-08-11 19:05:59 -04:00
Sam Ford
7e07010f06
Improve standardization of strategy tests 2021-08-11 19:05:59 -04:00
Sam Ford
56dd89114d
Standardize valid strategy block return types
Valid `strategy` block return types currently vary between
strategies. Some only accept a string whereas others accept a string
or array of strings. [`strategy` blocks also accept a `nil` return
(to simplify early returns) but this was already standardized across
strategies.]

While some strategies only identify one version by default (where a
string is an appropriate return type), it could be that a strategy
block identifies more than one version. In this situation, the
strategy would need to be modified to accept (and work with) an
array from a `strategy` block.

Rather than waiting for this to become a problem, this modifies all
strategies to standardize on allowing `strategy` blocks to return a
string or array of strings (even if only one of these is currently
used in practice). Standardizing valid return types helps to further
simplify the mental model for `strategy` blocks and reduce cognitive
load.

This commit extracts related logic from `#find_versions` into
methods like `#versions_from_content`, which is conceptually similar
to `PageMatch#page_matches` (renamed to `#versions_from_content`
for consistency). This allows us to write tests for the related code
without having to make network requests (or stub them) at this point.
In general, this also helps to better align the structure of
strategies and how the various `#find_versions` methods work with
versions.

There's still more planned work to be done here but this is a step
in the right direction.
2021-08-11 19:05:57 -04:00
Sam Ford
cf79ced740
Rework how strategy constants are identified
Up to this point, we've had to rely on making `Strategy` constants
private to ensure that the only available constants are strategies.
With the current setup, the existence of a constant that's not a
strategy would break `Strategy#strategies` and
`Livecheck#livecheck_strategy_names`.

Instead, we can achieve the same goal by skipping over constants
that aren't a class. Other than saving us from having to make these
constants private, this is necessary to be able to create a
`Strategy` constant that can be used in all strategies.
2021-08-11 18:25:34 -04:00
BrewTestBot
37e1d3cb71
Update RBI files for rubocop-ast. 2021-08-11 18:10:53 +00:00
BrewTestBot
8fd6f9735b
brew vendor-gems: commit updates. 2021-08-11 18:08:35 +00:00
dependabot[bot]
6333d0af30
build(deps): bump rubocop-ast from 1.9.0 to 1.9.1 in /Library/Homebrew
Bumps [rubocop-ast](https://github.com/rubocop-hq/rubocop-ast) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/rubocop-hq/rubocop-ast/releases)
- [Changelog](https://github.com/rubocop/rubocop-ast/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop-ast/compare/v1.9.0...v1.9.1)

---
updated-dependencies:
- dependency-name: rubocop-ast
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-11 18:04:48 +00:00
Bo Anderson
9686ebe355
os/mac/diagnostic: prevent some double diagostic failures 2021-08-11 14:19:22 +01:00
Bo Anderson
49f789d492
os/mac/xcode: bump minimum CLT version to 12.5 2021-08-11 14:19:22 +01:00
Bo Anderson
dae1d89780
os/mac/sdk: use MacOSX11.sdk symlink 2021-08-11 14:19:22 +01:00
Dustin Rodrigues
025d212db6
Merge pull request #11845 from dtrodrigues/typecheck-silicon 2021-08-11 08:04:12 -04:00
Carlo Cabrera
2d2aff3250
Merge pull request #11832 from AkihiroSuda/arch-allowlist 2021-08-11 19:19:34 +08:00
Dustin Rodrigues
c6bb748ea9
typecheck: allow typecheck command to run on Apple Silicon 2021-08-11 06:42:02 -04:00
Akihiro Suda
f63c3b08fe
New allow list: mismatched_binary_allowlist
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-08-11 18:09:26 +09:00
Mike McQuaid
62f7dcaa0e
dev-cmd/typecheck: don't suppress 5061 errors, do suppress 5067. 2021-08-11 09:40:57 +01:00
Mike McQuaid
3b13cf9797
Merge branch 'master' into dependabot/bundler/Library/Homebrew/sorbet-0.5.6519 2021-08-11 09:30:51 +01:00
BrewTestBot
e854fd4e25
Update RBI files for sorbet. 2021-08-11 08:28:34 +00:00
BrewTestBot
99be6d9302
brew vendor-gems: commit updates. 2021-08-11 08:26:20 +00:00
Mike McQuaid
79655bfd7f
Merge pull request #11843 from Bo98/stackprof
brew.rb: remove gem setup for stackprof
2021-08-11 09:15:44 +01:00
Mike McQuaid
0c337c4c12
brew vendor-gems: commit updates. 2021-08-11 09:14:58 +01:00
Mike McQuaid
ce887063de
Update sorbet 2021-08-11 09:13:41 +01:00
Carlo Cabrera
66dfcd44bd
Merge pull request #11841 from carlocab/cmake-args-params
formula: allow `std_cmake_args` to take parameters
2021-08-11 14:02:18 +08:00
Bo Anderson
d4b88b1b55
brew.rb: remove gem setup for stackprof 2021-08-11 02:13:37 +01:00
Carlo Cabrera
12435565f3
formula: allow std_cmake_args to take parameters
We have a handful of of formulae that do `std_cmake_args.reject` to
override some of flags (e.g. emscripten, icemon, ortp, qt, klee,
watchman).

Let's try to simplify some of this code by allowing these formulae to
override these flags by passing arguments to `std_cmake_args`.

While we're here, let's update the type signature of `std_cargo_args`.
2021-08-10 11:55:00 +08:00
BrewTestBot
4c344d8c09
sorbet: Update RBI files.
Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
2021-08-10 00:12:55 +00:00
Rylan Polster
9b2a504207
Fix API fetch methods in Utils::Analytics 2021-08-09 18:39:49 -04:00
Rylan Polster
b88158c148
Fix type for Homebrew::API::Bottle::download_bottle 2021-08-09 17:20:27 -04:00
Rylan Polster
489f5ed9d1
api: fix generic api path functions 2021-08-09 16:48:13 -04:00
BrewTestBot
f1be07c6b8
Update RBI files for rubocop-ast. 2021-08-09 18:11:34 +00:00
BrewTestBot
86b5f97424
brew vendor-gems: commit updates. 2021-08-09 18:09:02 +00:00
dependabot[bot]
cf275f8e64
build(deps): bump rubocop-ast from 1.8.0 to 1.9.0 in /Library/Homebrew
Bumps [rubocop-ast](https://github.com/rubocop-hq/rubocop-ast) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/rubocop-hq/rubocop-ast/releases)
- [Changelog](https://github.com/rubocop/rubocop-ast/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop-ast/compare/v1.8.0...v1.9.0)

---
updated-dependencies:
- dependency-name: rubocop-ast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-09 18:04:08 +00:00
Rylan Polster
90bbe8bb03
Merge pull request #11831 from Rylan12/api-cleanup
Refactor API methods
2021-08-09 12:32:55 -04:00
Rylan Polster
ab8aea0652
Fix tests 2021-08-09 11:00:00 -04:00
Rylan Polster
eab0f88c3c
Remove json argument and extend Cachable 2021-08-09 10:29:55 -04:00
Mike McQuaid
d829145459
Merge pull request #11834 from umireon/umireon-insert-space
Insert space
2021-08-09 13:25:06 +01:00
BrewTestBot
a48b12540f
spdx: update license data.
Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/spdx.yml).
2021-08-09 00:06:27 +00:00
Kaito Udagawa
fec4ff5ca3
Insert space
I got the following error message:

Install Clang or run `brew install gcc`.Alternatively, remove the flag to attempt bottle installation.

A space is missing after the period. This change ensures a space to be inserted.
2021-08-09 02:21:45 +09:00
Connor Mann
5ea678bbc7
Merge pull request #11824 from cnnrmnn/latest-head-kegs 2021-08-08 10:01:27 -04:00
Connor Mann
ed7066c183
Style fix 2021-08-06 22:35:16 -04:00
Connor Mann
1581a29b28
Update tests 2021-08-06 22:34:30 -04:00
Connor Mann
363bcbd72a
Sort head kegs by tab modification time 2021-08-06 21:27:21 -04:00
Rylan Polster
a8c03c1cc6
Restrict HOMEBREW_JSON_CORE use in tests 2021-08-06 11:52:21 -04:00
Rylan Polster
b1215800d4
Fix tests 2021-08-06 11:42:55 -04:00
BrewTestBot
b48d561225
brew vendor-gems: commit updates. 2021-08-06 13:06:58 +00:00
Bo Anderson
ff15e091ec
Add RBI file for Formula delegate methods 2021-08-06 14:03:18 +01:00
BrewTestBot
dc2b55f383
Update RBI files for sorbet. 2021-08-06 14:03:02 +01:00
Bo Anderson
cee86846ce
Fix Sorbet violations. 2021-08-06 14:03:00 +01:00
Bo Anderson
a5ff1b0b2e
Update Sorbet hidden definitions 2021-08-06 13:32:50 +01:00
Bo Anderson
07239d267c
Migrate from Sorbet DSL plugins to Parlour 2021-08-06 13:32:48 +01:00
Rylan Polster
f84265f9a2
Remove extra type signatures 2021-08-06 04:40:22 -04:00