29216 Commits

Author SHA1 Message Date
Markus Reiter
02dbeb62fc
Refactor RuboCop tests. 2023-05-09 04:28:25 +02:00
BrewTestBot
77a25eed28
sorbet: Update RBI files.
Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
2023-05-09 00:24:08 +00:00
Markus Reiter
4bbf120630
Add note about Version constructor. 2023-05-09 01:13:55 +02:00
Markus Reiter
ff71668f0a
Fix type errors. 2023-05-09 01:13:55 +02:00
Markus Reiter
fe19ddc3a7
Remove Version#empty?. 2023-05-09 01:13:55 +02:00
Markus Reiter
a1efaf1864
Merge HeadVersion and NullVersion into Version. 2023-05-09 01:13:54 +02:00
Markus Reiter
b05de929c6
Merge pull request #15351 from reitermarkus/livecheck-head
Use `curl_headers` and `curl_output` for `Livecheck` strategies.
2023-05-09 00:55:34 +02:00
Patrick Linnane
7c7ddd82fe
Revert "Merge pull request #15377 from carlocab/sorbet-runtime-take2"
This reverts commit cca98d5637d847548791b5afb16a5c609de2cb58, reversing
changes made to c0f8068573bbf886fdc78d3f9daca54d53e7e49e.
2023-05-08 12:16:11 -07:00
Mike McQuaid
b61d3500aa
Merge pull request #15270 from SMillerDev/feature/livecheck/github_latest_api
feat: use API for GitHub latest release strategy
2023-05-08 16:45:41 +01:00
Sam Ford
efccc5d4bb
GithubLatest: Update documentation 2023-05-08 17:21:19 +02:00
Austin Ziegler
74b50ddc89
Fix small errors in brew shellenv
These were introduced by typos and an incorrect assumption on the last
update of #15358. The last commit had been tested with a parameter, but
had not been re-tested *without* parameter.

Apologies for the error.
2023-05-08 11:06:30 -04:00
Carlo Cabrera
975c4e66f7
fetch: fix typecheck error
This is a better replacement of #15381.
2023-05-08 22:07:02 +08:00
Carlo Cabrera
9b369871e6
Revert "utils/bottles: fix typechecking error"
This reverts commit 071f6069d2cff272eaa9404f836cb1254c4fb588.
2023-05-08 21:43:12 +08:00
Carlo Cabrera
7d02626bbd
Merge pull request #15381 from carlocab/fix-sorbet-fetch
utils/bottles: fix typechecking error
2023-05-08 21:20:49 +08:00
Carlo Cabrera
071f6069d2
utils/bottles: fix typechecking error
https://github.com/Homebrew/homebrew-core/actions/runs/4915420737/jobs/8777887066?pr=130438#step:5:27
2023-05-08 21:07:58 +08:00
Mike McQuaid
b942294cf4
Merge pull request #15378 from reitermarkus/short-version-remove-build
Always remove build from `short_version`.
2023-05-08 12:47:18 +01:00
Mike McQuaid
63ad10392d
Merge pull request #15230 from reitermarkus/installer-manual-open
Make manual installers easier to open.
2023-05-08 12:46:34 +01:00
Mike McQuaid
628626b078
Merge pull request #15363 from halostatue/shellenv-shell-parameter
Allow brew shellenv to accept a shell name param
2023-05-08 12:39:05 +01:00
Mike McQuaid
cca98d5637
Merge pull request #15377 from carlocab/sorbet-runtime-take2
Revert "Revert "Merge pull request #15369 from carlocab/sorbet-runtime""
2023-05-08 12:11:07 +01:00
Markus Reiter
c0f8068573
Merge pull request #15223 from issyl0/rubocop-cask-stanza-order-in-on-blocks
rubocops/cask: Check for correct stanza order within `on_*` blocks
2023-05-08 09:36:30 +02:00
Markus Reiter
df620ad3ba
Make manual installers easier to open. 2023-05-08 08:25:32 +02:00
Markus Reiter
498ce8d18f
Merge pull request #15243 from aacerox/hotfix/cask-auth-redirect 2023-05-08 07:56:02 +02:00
alejandro.alvarez.acero
555ce9a5b0
Merge URL :header with :headers. 2023-05-08 07:41:06 +02:00
Markus Reiter
8db7e44ea7
Always remove build from short_version. 2023-05-08 05:38:13 +02:00
Carlo Cabrera
84cb8a42f7
Revert "Revert "Merge pull request #15369 from carlocab/sorbet-runtime""
We need to exclude any command that might read `lsyncd` on Linux while
simulating macOS. This seems like all of them.

This reverts commit bcf94f6e27d26a6844ee1fa7af73333321015987.
2023-05-08 11:37:48 +08:00
Sam Ford
303ac147a9
GithubLatest: Include URL in match_data
It's standard for the `match_data` to include the URL (e.g., as in
`PageMatch`). This uses the provided URL by default, switching to the
generated URL when available.
2023-05-07 10:21:48 +02:00
Sam Ford
cfba45fb56
GithubLatest: Use API URL as generated value
The generated URL should reflect what we're actually checking, which
is now the `/releases/latest` API URL.
2023-05-07 10:21:48 +02:00
Sam Ford
34e2779150
GithubLatest: Move #generate_input_values
`#generate_input_values` is called before `#versions_from_content`
(in `#find_versions`), so it makes sense to move it above the latter.
2023-05-07 10:21:48 +02:00
Sean Molenaar
573d87cdfa
feat: use API for GitHub latest release strategy 2023-05-07 10:21:48 +02:00
Markus Reiter
1df501b0ac
Tweak tests. 2023-05-07 10:04:28 +02:00
Markus Reiter
ce8788e5bc
Fix code style. 2023-05-07 08:34:13 +02:00
Markus Reiter
81fdb3716e
Implement StanzaOrder cop using on_cask_stanza_block. 2023-05-07 08:30:29 +02:00
Markus Reiter
2dea4f2370
Add on_cask_stanza_block. 2023-05-07 08:30:08 +02:00
Issy Long
8035d46dfe
very wip but reimagined
- Thanks to Markus on Slack for saying "the cop should only apply to the
  content of the blocks, or more specifically only to stanzas that are
  direct children of cask or on_* blocks", which made me realize that
  I was overcomplicating things.
2023-05-07 08:30:08 +02:00
Issy Long
a493787125
Regressed a bit, but at least it's not clobbering anymore? 2023-05-07 08:29:31 +02:00
Issy Long
704482d815
wip a test for ordering of both on_* blocks and their contents
- This is very broken, "detected clobbering" errors.
2023-05-07 08:29:31 +02:00
Issy Long
40bc235cb6
Simplify offending_stanzas method - pass sorted_stanzas in directly
- Otherwise we're doing the same "if inner" check twice, for no gain.
2023-05-07 08:29:30 +02:00
Issy Long
9457a23430
Extract methods for checking for on_* blocks and their contents
- The same code to do the same thing was getting a bit repetitive in
  `Cask/StanzaOrder`, `Cask/StanzaGrouping` and `Cask/NoOverrides`
  cops.
2023-05-07 08:29:30 +02:00
Issy Long
bd6e9e72a1
rubocops/cask: Check for correct stanza ordering within on_* blocks
- Now that we detect correct stanza _grouping_ within `on_*` blocks in
  Casks (PR 15211), correct stanza _ordering_ in `on_*` blocks was the
  next logical step. For example, `url` has to come after `version` and
  `sha256` in an `on_macos` or `on_intel` block for consistency with the
  top-level stanza order we enforce elsewhere.
- Still not doing the nested `on_os` inside `on_arch`, that felt
  excessive for an edge case that isn't present in any actual real
  Casks we have. I removed the test with that specific TODO.
2023-05-07 08:27:43 +02:00
Markus Reiter
1120812378
Merge pull request #15374 from carlocab/longer-arm-timeout
github_runner_matrix: align Intel and ARM timeouts
2023-05-06 23:21:01 +02:00
Carlo Cabrera
0b33a09090
github_runner_matrix: align Intel and ARM timeouts
This prevents situations where the Intel runners have a 360 minute
timeout but the ARM runners only have 45 minutes.

See Homebrew/homebrew-core#130284.
2023-05-07 00:14:54 +08:00
Markus Reiter
353818f508
Rename curl_head to curl_headers. 2023-05-06 03:41:35 +02:00
Markus Reiter
545a332fef
Use curl_head and curl_output for Livecheck strategies. 2023-05-06 03:40:09 +02:00
Markus Reiter
dfc9d94c5b
Type livecheck.rb. 2023-05-06 03:27:42 +02:00
Patrick Linnane
bcf94f6e27
Revert "Merge pull request #15369 from carlocab/sorbet-runtime"
This reverts commit 8c059bba279f4b72b783fca91746d14b6286e6fc, reversing
changes made to f71b3d37abcc9cd12b0c8a621bc3712c00db8ec1.
2023-05-05 09:38:02 -07:00
Austin Ziegler
8719946036
Allow brew shellenv to accept a shell name param
Resolves #15358

With this change, `brew shellenv` will accept a shell name parameter to
override its default output (based on `/bin/ps`) for advanced use cases
such as with dotfile templating and caching with
[twpayne/chezmoi](https://github.com/twpayne/chezmoi/discussions/2971).
When running under `fish`, this is the output:

```console
$ brew shellenv pwsh
[System.Environment]::SetEnvironmentVariable('HOMEBREW_PREFIX','/opt/homebrew',[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('HOMEBREW_CELLAR','/opt/homebrew/Cellar',[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('HOMEBREW_REPOSITORY','/opt/homebrew',[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('PATH',$('/opt/homebrew/bin:/opt/homebrew/sbin:'+$ENV:PATH),[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('MANPATH',$('/opt/homebrew/share/man'+$(if(${ENV:MANPATH}){':'+${ENV:MANPATH}})+':'),[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('INFOPATH',$('/opt/homebrew/share/info'+$(if(${ENV:INFOPATH}){':'+${ENV:INFOPATH}})),[System.EnvironmentVariableTarget]::Process)
$ brew shellenv
set -gx HOMEBREW_PREFIX "/opt/homebrew";
set -gx HOMEBREW_CELLAR "/opt/homebrew/Cellar";
set -gx HOMEBREW_REPOSITORY "/opt/homebrew";
set -q PATH; or set PATH ''; set -gx PATH "/opt/homebrew/bin" "/opt/homebrew/sbin" $PATH;
set -q MANPATH; or set MANPATH ''; set -gx MANPATH "/opt/homebrew/share/man" $MANPATH;
set -q INFOPATH; or set INFOPATH ''; set -gx INFOPATH "/opt/homebrew/share/info" $INFOPATH;
```

The specific case presented in the mentioned discussion could be
mitigated by an additional level of indirection (`{{ output "fish" "-c"
"'brew shellenv'" | trim }}`), that requires that the running system
have the target shells installed, when they are not strictly necessary
with `brew shellenv`.
2023-05-05 11:50:48 -04:00
Carlo Cabrera
f68b635513
Revert "Revert "Enable Sorbet by default for Homebrew developers and developer commands.""
Along with some fixes for failures in Homebrew/core. See discussion at #15368.

This reverts commit e49cd331dba71b1ced341f1838c7651ecff46a38.
2023-05-05 21:40:51 +08:00
Mike McQuaid
f71b3d37ab
Merge pull request #15367 from dawidd6/pypi-version-to-s
bump-formula-pr: fix method argument type
2023-05-05 13:34:12 +01:00
Dawid Dziurla
e49cd331db
Revert "Enable Sorbet by default for Homebrew developers and developer commands." 2023-05-05 13:58:58 +02:00
Dawid Dziurla
a341f4346c
bump-formula-pr: fix method argument type 2023-05-05 13:51:14 +02:00