2200 Commits

Author SHA1 Message Date
Markus Reiter
b6d529dab3
Convert Downloadable to a module. 2024-09-04 22:54:21 +02:00
Markus Reiter
b297be77a1
Implement concurrent downloads. 2024-09-04 22:54:20 +02:00
Bo Anderson
0ae1dbeacf
Add typing for Cask#url and fix detected issues 2024-08-23 16:39:23 +01:00
Bo Anderson
f877fc5058
livecheck: remove module_function 2024-08-23 04:57:28 +01:00
Lukas Eipert
915917f4d2 Rosetta audit: Build full executable path
The method only returned the executable name and not the full path,
leading to a swallowed error, because brew gracefully ignores a
failing lipo command.
2024-08-21 13:19:57 +02:00
Mike McQuaid
b3082182f4
Merge pull request #18109 from leipert/leipert-fix-rosetta-audit 2024-08-21 09:53:30 +01:00
Lukas Eipert
8814a492aa Use plist main binary for Rosetta audit
Currently `brew audit` only audits the first binary in a cask.
For example the cask `wiso-steuer-2024` contains multiple binaries in
`Contents/MacOS`:
- `btssysteminfo`
- `whilfe`
- `wmain24`

The first binary (some telemetry tool) is not the main binary and not
a universal binary, but the other two are. Given that `wmain24` is
defined as the main binary in the `Contents/Info.plist`, brew probably
should audit that binary rather than just checking the first one.
2024-08-21 10:01:20 +02:00
Bo Anderson
6db4ed2793
Replace some include Kernel usages with requires_ancestor 2024-08-20 19:10:14 +01:00
Douglas Eichelberger
b3cb9420ab
Merge pull request #18081 from Homebrew/type-safety
Minor type safety improvements
2024-08-19 13:24:10 -07:00
Douglas Eichelberger
fb2fdc5249 Minor type safety improvements 2024-08-18 18:16:39 -07:00
Douglas Eichelberger
f4e04c8951 Make Cask::Artifact::Installer typesafe 2024-08-18 16:10:35 -07:00
Bevan Kay
dcce0584bd
Revert "Make Cask::Artifact::Installer typesafe" 2024-08-13 08:24:20 +10:00
Douglas Eichelberger
32107f2cb3
Merge pull request #18020 from Homebrew/installer-safety
Make Cask::Artifact::Installer typesafe
2024-08-12 13:35:21 -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
Mike McQuaid
6105728c31
Merge pull request #18004 from Homebrew/more-srb-strict 2024-08-12 14:22:00 +01:00
Mike McQuaid
6b3cac7b89
Merge pull request #18019 from Homebrew/safe-try-new 2024-08-12 14:21:44 +01:00
Bevan Kay
7e04c96c29
cask/dsl/caveats: fix rosetta caveat printing 2024-08-12 16:52:05 +10:00
Douglas Eichelberger
c799f5f818 Allow Cask refs 2024-08-11 18:01:04 -07:00
Douglas Eichelberger
a41f15ede7 Make FromContentLoader.try_new typesafe 2024-08-11 17:10:55 -07:00
Douglas Eichelberger
52b25d71f5 Make Cask::Artifact::Installer typesafe 2024-08-11 16:56:20 -07:00
Markus Reiter
8e08a698d1
Merge pull request #17562 from reitermarkus/token-auditor
Share code between cask token and formula name audits.
2024-08-10 19:46:32 +02:00
Issy Long
0355f07e0d
utils/shared_audits: Bump to Sorbet typed: strict 2024-08-10 16:43:37 +01:00
Mike McQuaid
feb1d5593d
cask/info: tweak style. 2024-08-05 09:33:59 +01:00
Harald Nordgren
676bc0e38f
Update Library/Homebrew/cask/info.rb
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2024-08-03 21:20:52 +02:00
Harald Nordgren
7cf5c2cdd9 Show dependencies for casks 2024-08-03 20:25:13 +02:00
Markus Reiter
4a1643e7ad
Refactor condition. 2024-07-30 21:48:59 +02:00
Markus Reiter
40d55f8035
Change type name. 2024-07-30 21:43:30 +02:00
Markus Reiter
3b4e1cb573
Share code between cask token and formula name audits. 2024-07-30 21:41:15 +02:00
Mike McQuaid
7abc6f4349
cask/installer: improve *_FORBIDDEN_* env handling.
- Improve the error message when a cask or formula is forbidden by an
  environment variable (fixes #17880)
- Move the `forbidden_tap_check` and `forbidden_cask_and_formula_check`
  methods to the top of the `install` method, so that they are checked
  before the main cask is downloaded.
2024-07-27 16:13:51 +01:00
Bo Anderson
10cbf191dc
Add env to disable finding packages from paths 2024-07-25 11:37:44 +01:00
Bo Anderson
d39a3a3030
Merge pull request #17788 from Homebrew/more-sorbet-strict
sorbet: Bump more files to `typed: strict`
2024-07-25 02:23:23 +01:00
Bevan Kay
b633dfd5a5
cask/dsl/caveats: fix conditional 2024-07-25 09:40:29 +10:00
Issy Long
fdb661e2b9
cask/info: Bump to Sorbet typed: strict 2024-07-22 22:11:17 +01:00
Kevin
d686be67c6
Merge pull request #17761 from eaze/cask-quiet-upgrade
Add better "--quiet" support to cask upgrade
2024-07-19 22:54:51 -07:00
Bo Anderson
ec41f66ee7
cask/artifact/installer: reset UID when running scripts 2024-07-17 06:33:08 +01:00
Klaus Hipp
d90c5c55d2
cask/audit: handle cask_min_os is nil 2024-07-16 10:35:47 -04:00
Rylan Polster
86bf1eacdb
Merge pull request #17763 from Homebrew/fix-tap-git-head 2024-07-15 14:11:34 -04:00
Rylan Polster
c4dabb5527
Have tap_git_head return nil when no tap is installed 2024-07-15 13:47:21 -04:00
Eric Sampson
d40ab11784 Add "-quiet" support to cask updgrade 2024-07-15 11:50:37 -05:00
Justin Krehel
0799222df2
cask/info: fix installed size reporting 2024-07-15 11:24:38 -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
Rylan Polster
8b0a4a98bf
Restrict direct url installs to the file:// scheme 2024-07-13 13:30:36 -04:00
Mike McQuaid
f39b5c1426
Merge pull request #17554 from Homebrew/cask-install-receipt 2024-07-13 10:55:06 -04:00
Rylan Polster
fec84544a9
Remove arch and macos dependencies from cask tab 2024-07-10 11:25:05 -04:00
Rylan Polster
d17da89382
Include recursive dependencies in cask tabs 2024-07-09 15:25:57 -04:00
Rylan Polster
119e02ceb0
Cleanup tap_git_head and uninstall_flight_blocks?
Co-authored-by: Kevin <apainintheneck@gmail.com>
2024-07-09 13:22:00 -04:00
Bevan Kay
a77a8ca564
cask/dsl/caveats: allow for simulated system checks in rosetta caveat 2024-07-09 15:42:38 +10:00
Rylan Polster
79fd5ee2b7
Refactor tap and versions 2024-07-05 10:07:30 -04:00
Rylan Polster
e176159b23
Fix test 2024-07-04 12:27:45 -04:00
Rylan Polster
3a732460e9
Refactor Tab create method 2024-07-04 11:18:26 -04:00