1554 Commits

Author SHA1 Message Date
Mike McQuaid
c8e8aa5600
Merge pull request #17756 from reitermarkus/concurrent-downloads
Implement concurrent downloads in `brew fetch`.
2024-09-09 08:41:11 +01:00
Ruoyu Zhong
b03e0e4696
formula: update URL to SPDX license expr docs 2024-09-06 19:44:58 +08:00
Markus Reiter
a970065657
Fix wrong argument passing. 2024-09-05 17:20:20 +02:00
Markus Reiter
846cf25043
Fix wrong argument passing. 2024-09-05 17:19:07 +02:00
Markus Reiter
123a2ac84c
Comment deprecations.
Co-authored-by: Bo Anderson <mail@boanderson.me>
2024-09-05 17:18:00 +02:00
Markus Reiter
404176af1d
Implement Downloadable for more types. 2024-09-04 22:54:28 +02:00
Markus Reiter
b297be77a1
Implement concurrent downloads. 2024-09-04 22:54:20 +02:00
Carlo Cabrera
c73d08c75b
Update comment re #nil? vs #blank? 2024-09-02 16:02:35 +08:00
Carlo Cabrera
654a58237e
formula: make audit_result a kwarg in inreplace
This allows us to get rid of a RuboCop disable, and will make formulae
easier to read.
2024-09-01 05:05:13 +08:00
Douglas Eichelberger
fb2fdc5249 Minor type safety improvements 2024-08-18 18:16:39 -07:00
Issy Long
45978435e7
rubocop: Use Sorbet/StrictSigil as it's better than comments
- Previously I thought that comments were fine to discourage people from
  wasting their time trying to bump things that used `undef` that Sorbet
  didn't support. But RuboCop is better at this since it'll complain if
  the comments are unnecessary.

- Suggested in https://github.com/Homebrew/brew/pull/18018#issuecomment-2283369501.

- I've gone for a mixture of `rubocop:disable` for the files that can't
  be `typed: strict` (use of undef, required before everything else, etc)
  and `rubocop:todo` for everything else that should be tried to make
  strictly typed. There's no functional difference between the two as
  `rubocop:todo` is `rubocop:disable` with a different name.

- And I entirely disabled the cop for the docs/ directory since
  `typed: strict` isn't going to gain us anything for some Markdown
  linting config files.

- This means that now it's easier to track what needs to be done rather
  than relying on checklists of files in our big Sorbet issue:

```shell
$ git grep 'typed: true # rubocop:todo Sorbet/StrictSigil' | wc -l
    268
```

- And this is confirmed working for new files:

```shell
$ git status
On branch use-rubocop-for-sorbet-strict-sigils
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Library/Homebrew/bad.rb
        Library/Homebrew/good.rb

nothing added to commit but untracked files present (use "git add" to track)

$ brew style
Offenses:

bad.rb:1:1: C: Sorbet/StrictSigil: Sorbet sigil should be at least strict got true.
^^^^^^^^^^^^^

1340 files inspected, 1 offense detected
```
2024-08-12 15:24:27 +01:00
Branch Vincent
0c0b95fae5
formula: remove std_npm_args from system's pretty_args 2024-07-25 17:11:12 -07:00
Bo Anderson
5edcaf3f06
Merge pull request #17774 from branchvincent/std_npm_args
formula: add `std_npm_args`
2024-07-25 05:41:19 +01:00
Patrick Linnane
7b8d0e6b7f
Formula-Cookbook: add std_*_args explanations
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-07-17 17:36:51 -07:00
Branch Vincent
959bf283ae
formula: add std_npm_args 2024-07-15 23:43:37 -07:00
Branch Vincent
62b2786934
formula: fix missing require 2024-07-15 21:37:31 -07:00
Rylan Polster
c4dabb5527
Have tap_git_head return nil when no tap is installed 2024-07-15 13:47:21 -04:00
Mike McQuaid
8f863199bc
Merge pull request #17754 from Moisan/formula_utils_git_repository 2024-07-15 16:52:41 +02:00
Thierry Moisan
84b725f01f
formula: add require utils/gzip 2024-07-15 10:09:12 -04:00
Thierry Moisan
4f80ef3049
formula: require utils/git_repository 2024-07-15 09:50:14 -04:00
Mike McQuaid
c5dbd3ca24
Rearrange requires
This improves the load time of most brew commands. For an example of
one of the simplest commands this speeds up:

Without Bootsnap:
```
$ hyperfine 'git checkout master; brew help' 'git checkout optimise_requires; brew help'
Benchmark 1: git checkout master; brew help
  Time (mean ± σ):     525.0 ms ±  35.8 ms    [User: 229.9 ms, System: 113.1 ms]
  Range (min … max):   465.3 ms … 576.6 ms    10 runs

Benchmark 2: git checkout optimise_requires; brew help
  Time (mean ± σ):     383.3 ms ±  25.1 ms    [User: 133.0 ms, System: 72.1 ms]
  Range (min … max):   353.0 ms … 443.6 ms    10 runs

Summary
  git checkout optimise_requires; brew help ran
    1.37 ± 0.13 times faster than git checkout master; brew help
```

With Bootsnap:
```
$ hyperfine 'git checkout master; brew help' 'git checkout optimise_requires; brew help'
Benchmark 1: git checkout master; brew help
  Time (mean ± σ):     386.0 ms ±  30.9 ms    [User: 130.2 ms, System: 93.8 ms]
  Range (min … max):   359.5 ms … 469.3 ms    10 runs

Benchmark 2: git checkout optimise_requires; brew help
  Time (mean ± σ):     330.2 ms ±  32.4 ms    [User: 93.4 ms, System: 73.0 ms]
  Range (min … max):   302.9 ms … 413.9 ms    10 runs

Summary
  git checkout optimise_requires; brew help ran
    1.17 ± 0.15 times faster than git checkout master; brew help
```
2024-07-14 08:49:39 -04:00
Mike McQuaid
f39b5c1426
Merge pull request #17554 from Homebrew/cask-install-receipt 2024-07-13 10:55:06 -04:00
Rylan Polster
acd60181c2
Add cask install receipts 2024-07-04 01:47:13 -04:00
Rylan Polster
c16a9b33b2
Use cached json API file for formulae and cask specified paths 2024-07-03 13:41:52 -04:00
Mike McQuaid
c13700af00
Use repository consistently instead of repo
The documentation linting job doesn't like `repo` so let's fix this
globally rather than naming it differently in documentation and code.
2024-06-10 09:31:53 +01:00
Douglas Eichelberger
179419d8bc rm unnecessary casts 2024-05-31 15:49:12 -07:00
Mike McQuaid
b066ac414c
SBOM: various fixes.
- be a bit stricter with SBOM handling with the test default formula
  flow in CI by making it raise errors if SBOM's aren't generated and
  validated as expected
- fix handling of HEAD installations of formulae so SBOM generation is
  both correct and doesn't raise errors
- make `Formula#bottle_hash` more accepting of edge cases e.g. HEAD-only
  formulae without a stable spec

Fixes #17333
2024-05-20 09:41:29 +01:00
Caleb Xu
920364ca87
formula: trap CMake FetchContent usage instead of using FETCHCONTENT_FULLY_DISCONNECTED 2024-05-17 14:41:08 -04:00
Mike McQuaid
cff0531888
formula: this was nilable before so remove it.
Other maintainers consider this preferable to setting to `odeprecated`.
2024-05-13 07:42:20 +01:00
Mike McQuaid
222fe8ef0b
Homebrew 4.3.0 deprecation/disable/removals.
The usual pass of deprecating/disabling/removing code for the next
minor Homebrew release.
2024-05-07 12:18:04 +01:00
Markus Reiter
e39a421bb0
Add resource signature. 2024-05-03 22:29:50 +02:00
Mike McQuaid
9da18b634c
formula: fix missing test resources.
Revert one change from https://github.com/Homebrew/brew/pull/17165.

It's unclear to me why this fixes the problem, but it does.

Fixes https://github.com/Homebrew/brew/issues/17203
2024-05-03 08:29:10 +01:00
Markus Reiter
caf87c0336
Warn about undocumented non-private APIs. 2024-05-01 11:35:20 +02:00
Mike McQuaid
7c0b989740
Merge pull request #17153 from apainintheneck/new-formula-json-dependencies-format
New formula internal json v3 dependencies format
2024-05-01 08:45:18 +01:00
apainintheneck
6ad02b8e34 formula: internal json v3 dependencies: address feedback
- rename #dependencies_list to #internal_dependencies_hash
  - the initial implementation returned an array but now it doesn't
- simplify usage of #tap in #internal_dependencies_hash
- remove safe navigation operator usages in #internal_dependencies_hash
- better document why implicit dependencies are not included in the API JSON
- add new test fixture formula to better test generation of uses from
  macos bounds with the new internal json format
2024-04-30 23:44:25 -07:00
Markus Reiter
0b56d0be4a
Document Tab.for_keg and use Keg#tab where possible. 2024-04-28 20:50:13 +02:00
apainintheneck
039eb1adff Update formula internal json v3 to improve dependencies readability
This improves the readability of dependencies in the json we
produce for this internally.
2024-04-27 18:07:54 -07:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Markus Reiter
c76170a456
Hide #to_s in docs. 2024-04-26 14:04:55 +02:00
Markus Reiter
fe4ef62aa9
Hide #inspect in docs. 2024-04-26 13:20:05 +02:00
Branch Vincent
4bf8fef5aa
Reapply "formula: configure git/npm to ignore .brew_home"
This reverts commit abf8df38661c4b60f122336d3db3a1a810d3a0e8.
2024-04-23 18:35:55 -07:00
Mike McQuaid
abf8df3866
Revert "formula: configure git/npm to ignore .brew_home" 2024-04-23 16:09:57 +01:00
Mike McQuaid
b5f857b627
Merge pull request #17081 from alebcay/formula-offline-phases
Support for opt-in network isolation in build/test sandboxes
2024-04-23 08:30:10 +01:00
Mike McQuaid
5ad4e6e293
Merge pull request #17128 from reitermarkus/docs-api-public
Explicitly mark non-private APIs.
2024-04-23 08:28:27 +01:00
Caleb Xu
7c11699d73
formula: add methods for allowing/denying network access 2024-04-22 22:39:44 -04:00
Markus Reiter
4b432c7ea4
Explicitly mark non-private APIs. 2024-04-22 21:16:49 +02:00
Branch Vincent
46a3bbe3c5
formula: configure git/npm to ignore .brew_home 2024-04-19 11:45:25 -07:00
Caleb Xu
60d9e63ae4
formula: add FETCHCONTENT_FULLY_DISCONNECTED to std_cmake_args 2024-04-11 13:03:33 -04:00
Michael Cho
f81dcd8c58
go_resource deprecation comments
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-04-01 09:00:32 -04:00
apainintheneck
db507be41a keg: update sorting by version logic
This updates logic to add a `#scheme_and_version` method to be used
with `.sort_by` and `.max_by`. Using `Keg#version` by itself can be
inaccurate when different version schemes are present. This also
updates the behavior of `Formula#eligible_kegs_for_cleanup` to match
the previous behavior. We were dropping the wrong keg based on the
sort being reversed in a previous PR.
2024-03-31 17:52:32 -07:00