17 Commits

Author SHA1 Message Date
Eric Knibbe
f92e961ff1
github_runner_matrix: fix skipped runner creation 2025-07-01 15:07:24 -04:00
Rylan Polster
c03f70f1dc
Refactor OnSystem and SimulateSystem bottle tag handling 2025-06-03 11:57:17 -04: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
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
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Patrick Linnane
c56669e9cd
various: fix miscellaneous typos 2023-07-18 08:52:49 -07:00
Markus Reiter
a97e63efbf
Fix tests on generic OS. 2023-05-17 15:26:46 +02:00
Carlo Cabrera
28c593ed6a
simulate_system: fix tap_syntax job errors
Fixes

    Error: Cannot simulate :ventura :intel while already simulating :macos.

See https://github.com/Homebrew/homebrew-core/actions/runs/4974116510/jobs/8900390980#step:4:24.
2023-05-15 13:44:51 +08:00
Markus Reiter
0d56b97b07
Add SimulateSystem::with. 2023-05-14 01:45:04 +02:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
apainintheneck
2eee1e7c2a Move SimulateSystem check to extend/os 2022-11-29 23:13:50 -08:00
Rylan Polster
ea1f2098ac
Move HOMEBREW_SIMULATE_MACOS_ON_LINUX handling to SimulateSystem 2022-07-28 15:04:25 -04:00
Rylan Polster
4cc0e854ce
Rename treat_as_*? to simulating_or_running_on_*? 2022-07-28 09:18:16 -04:00
Rylan Polster
fa384b03fa
Simplify SimulateSystem usage 2022-07-23 03:08:56 +02:00
Rylan Polster
ac067eedb2
Create MacOSVersions module 2022-06-29 11:34:49 -04:00
Rylan Polster
5ec19adf58
Rename Override module to SimulateSystem 2022-06-28 15:35:20 -04:00