297 Commits

Author SHA1 Message Date
Issy Long
6c11916cbc
Bump some files to Sorbet typed: strict 2025-04-27 22:45:44 +01:00
Mike McQuaid
c9a7b62b1d
Homebrew 4.5 deprecations/disables/removals
The usual cycle of deprecating, disabling, and removing things in
Homebrew major/minor releases.
2025-04-22 17:15:23 +01:00
Douglas Eichelberger
e58486cd4c
fix: Allow Formula.url with no args to get url 2025-03-26 12:15:25 -07:00
Douglas Eichelberger
fcf18912fe
Inline use of attr_predicate 2025-03-02 21:36:03 -08:00
Mike McQuaid
2b737f0423
Split up SoftwareSpec
This came up in the AGM and has bothered me for years: let's actually
split out `software_spec.rb` into one file per class, as is more typical
in Ruby.

This will make these classes easier to find.
2025-02-04 16:27:39 +00:00
Bo Anderson
fed5321969
Rename aarch64_linux tag to arm64_linux 2025-02-01 13:03:58 +01:00
Mike McQuaid
e030625eb4
Merge pull request #18172 from cho-m/brew-info-size
cmd/info: show size information
2024-09-25 14:02:38 +01:00
Michael Cho
ea0776c425
cmd/info: show size information
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Markus Reiter <me@reitermark.us>
2024-09-25 08:56:33 +01:00
Mike McQuaid
94416e82f0
Add new odeprecated, odisabled, remove disabled code.
Prepare the usual deprecation cycle for Homebrew 4.4.0.
2024-09-24 10:15:34 +01:00
Bo Anderson
45c88cc508
software_spec: fix invalid manifest handling 2024-09-16 00:39:53 +01:00
Markus Reiter
fb0bf3b7a2
Fix wrong stage method being called. 2024-09-05 00:21:33 +02:00
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
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
Bo Anderson
bbdf52cdc6
software_spec: remove confusing missing version error 2024-07-25 02:17:27 +01:00
Markus Reiter
ae6f43921a
Implement verify_download_integrity for bottle manifests. 2024-07-13 16:50:53 -04:00
Markus Reiter
05f07953fe
Create Resource::BottleManifest. 2024-07-13 16:47:00 -04: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
Markus Reiter
480e264d9a
Lint Ruby docs. 2024-05-01 11:35:21 +02:00
Markus Reiter
caf87c0336
Warn about undocumented non-private APIs. 2024-05-01 11:35:20 +02:00
Markus Reiter
c76170a456
Hide #to_s in docs. 2024-04-26 14:04:55 +02:00
William Woodruff
e2b5d93198
more attestation coverage
Signed-off-by: William Woodruff <william@yossarian.net>
2024-04-11 13:39:13 -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
Bo Anderson
bb0252875e
utils/bottles: fix outdated bottle check 2024-03-30 03:29:51 +00:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Issy Long
f4218a6316
Fix RuboCop Performance/MapCompact offenses
- Rename an iterator variable since it would make the line too long.
2024-02-25 22:59:59 +00:00
Markus Reiter
c6788bb27e
Avoid T.unsafe. 2024-02-13 00:42:54 +01:00
Markus Reiter
d9712f4d50
Refactor and add type signature for uses_from_macos. 2024-02-13 00:31:10 +01:00
Markus Reiter
4762f644cb
Remove @uses_from_macos_elements variable. 2024-02-12 23:46:18 +01:00
Douglas Eichelberger
5b5cfe89de Resolve violations from removing hidden.rbi 2024-02-11 20:27:38 -08:00
Mike McQuaid
65bf26fb27
Merge pull request #16416 from Bo98/safe-filename
Add consistent path validation
2024-01-01 18:48:28 +00:00
Bo Anderson
5aebde3ffd Add consistent path validation 2024-01-01 18:37:47 +00:00
Douglas Eichelberger
ffd761d2e9 Create dedicated Attrable mixin for attr_ methods 2023-12-28 11:46:27 -08:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Douglas Eichelberger
3c0506e276 Fix tag_to_cellar 2023-11-05 12:23:42 -08:00
Douglas Eichelberger
0191af7899 resolve typecheck errors 2023-11-05 08:55:58 -08:00
Bo Anderson
de83bc69e0
Implement equality functions for BottleSpecification 2023-10-23 16:17:31 +01:00
Mike McQuaid
7da934f7e2
Deprecate/disable/delete code.
The next release after this is merged will be 4.1.0.

Co-authored-by: Markus Reiter <me@reitermark.us>
2023-07-06 16:56:20 +01:00
Bo Anderson
d1b923f314
Introduce UsesFromMacOSDependency
Add Formula#declared_deps and SoftwareSpec#declared_deps
2023-07-04 13:40:55 +01:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Bo Anderson
44f058edb5
Refactor formula, cask and Ruby source downloads to use shared code 2023-04-27 23:23:07 +01:00
Douglas Eichelberger
08af78a2a5 brew style --fix 2023-04-25 09:26:24 -07:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Mike McQuaid
63d8de3600
brew style --fix 2023-04-07 19:10:22 +01:00
Issy Long
6d822d9a62
rubocop: Drop "fn" from Naming/MethodParameterName allowlist
- I originally thought this was short for "function", but upon closer
  inspection all its usages are to do with filenames. So, use "filename",
  it's clearer.
2023-03-08 14:40:56 +00:00
Bo Anderson
9b99594753
Preliminary compatibility fixes for Ruby 3 2022-10-11 02:53:27 +01:00
Bo Anderson
6c4245e298
software_spec: fix bottle resource version type 2022-09-01 18:47:38 +01:00
Bo Anderson
abfbb46678
Freeze formula definition once first instance is created 2022-08-31 20:40:42 +01:00
Michka Popoff
d271614872
install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See 9692318ca6/Formula/gcc%405.rb (L33)

This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from one gcc formula to another..
Also, not having the right glibc version results in a non-functional brew
installation on an older Linux: the glibc installation needs
to be done by brew, and not by a workaround in a specific formula

Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
Co-Authored-By: Bo Anderson <mail@boanderson.me>
Co-Authored-By: Shaun Jackman <sjackman@gmail.com>
2022-08-25 11:04:37 +01:00