175 Commits

Author SHA1 Message Date
Rylan Polster
54b349bb89
Revert "Only generate cask variations for supported macOS configurations" 2025-06-12 11:53:01 -04:00
Rylan Polster
e5667cb5ae
Only generate cask variations for supported macOS configurations 2025-06-11 20:30:14 -04:00
Mike McQuaid
dc71b7c8f6
Cleanup extend/ directory usage.
- move some things out of `extend` that don't really fit there e.g.
  `Module`s that are included but not doing any
  overriding/monkeypatching
- move some code into `extend/os` to fix all remaining
  `rubocop:todo Homebrew/MoveToExtendOS`s
- remove some unneeded `bundle` skipper code that doesn't really make
  sense given our current bottling strategy
- extract some `Pathname` extensions to `extend/pathname` for separate
  files
- move a `ENV` `Kernel` extension into `kernel.rb`
- `odeprecate` a seemingly unused backwards compatibility method
- move `readline_nonblock` from a monkeypatch to a
  `ReadlineNonblock.read` method as its only used in one place
- fix up a link in documentation
2025-06-09 19:06:16 +01:00
Rylan Polster
c03f70f1dc
Refactor OnSystem and SimulateSystem bottle tag handling 2025-06-03 11:57:17 -04:00
botantony
ad66e0c418 tap: get autobump list from formula/cask API
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
botantony
1fcacdc2dc formula/cask DSL: add no_autobump! method
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
botantony
4fa1355be0 deprecate!/disable!: remove non-typed replacement field
Signed-off-by: botantony <antonsm21@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-04-21 21:13:25 +02:00
Eric Knibbe
57f764a1d8 cask/api: remove control characters from cask caveats 2025-03-24 15:43:15 -04:00
Sean Molenaar
756ba2ba59 Add Linux dependency check in cask.rb 2025-03-13 21:47:17 +01:00
Sean Molenaar
9f6b421ad6 fix: check OS for macos dependency 2025-03-13 21:28:40 +01:00
Sean Molenaar
a137426839 feat: generate cask API for linux 2025-03-13 21:28:40 +01:00
Douglas Eichelberger
fcf18912fe
Inline use of attr_predicate 2025-03-02 21:36:03 -08:00
Rylan Polster
f874603a21 Add implicit macOS dependency to casks without explicit depends_on stanza 2025-02-17 14:30:44 +01:00
Douglas Eichelberger
d8c790dddc Use delegation to create Cask DSL methods 2025-02-11 08:33:04 -08:00
apainintheneck
042d6cc97e Remove JSON v3 cask logic 2025-02-05 23:32:32 -08:00
Mike McQuaid
93a9776e34
cask/cask: ensure plist is readable before reading.
If we don't have permissions to read it, this will raise an exception
even although this whole call chain is very tolerant of nil values.
2025-01-14 08:52:20 +00:00
Caleb Xu
215fc85579
deprecate_disable: support optional replacement parameter 2024-11-08 15:49:00 -05:00
Douglas Eichelberger
a2612e23dc
Apply suggestions from code review
Co-authored-by: Kevin <apainintheneck@gmail.com>
2024-11-05 16:44:12 +00:00
Douglas Eichelberger
521c463e36
Manually resolve Style/SafeNavigationChainLength violations 2024-11-05 16:44:12 +00:00
Bevan Kay
69f04bc069
cask/cask: pass args when initialising dsl 2024-10-10 10:36:44 +11:00
Douglas Eichelberger
8033fcf4a6 Fix brew style docs 2024-10-07 18:59:27 -07:00
Bo Anderson
0ae1dbeacf
Add typing for Cask#url and fix detected issues 2024-08-23 16:39:23 +01: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
Rylan Polster
c4dabb5527
Have tap_git_head return nil when no tap is installed 2024-07-15 13:47:21 -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
Rylan Polster
acd60181c2
Add cask install receipts 2024-07-04 01:47:13 -04:00
Eric Knibbe
1ef1b0b556
cask: ignore minimum macOS in on_os blocks for variations 2024-06-20 23:19:09 -04:00
Eric Knibbe
2d00e50071
cask: skip variations for inapplicable versions 2024-06-03 12:33: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
caf87c0336
Warn about undocumented non-private APIs. 2024-05-01 11:35:20 +02: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
Markus Reiter
26d1ff5ccb
Fix CI. 2024-04-23 02:07:42 +02:00
Markus Reiter
4b432c7ea4
Explicitly mark non-private APIs. 2024-04-22 21:16:49 +02:00
Bo Anderson
326bc3f889
Fix cask source checksum handling 2024-03-19 21:21:37 +00:00
apainintheneck
08442734ab s/Tap.reverse_tap_migrations_renames/Tap.tap_migration_oldnames/ 2024-03-09 10:27:22 -08:00
apainintheneck
d4a273443c tap: add #reverse_tap_migrations_renames to speed things up
This gets used by `Tap.reverse_tap_migrations_renames` and reduces
the amount of information that needs to be calculated on the fly
every time.
2024-03-09 10:25:47 -08:00
Mike McQuaid
b70884a474
Merge pull request #16848 from Homebrew/rubocop_default_hash_syntax
rubocop: default hash syntax.
2024-03-08 07:55:33 +00:00
apainintheneck
e0cea903ec s/to_api_hash/to_internal_api_hash/ 2024-03-07 20:29:58 -08:00
apainintheneck
12d5a40262 dev-cmd/generate-cask-api: start generating cask internal JSON v3
This adds a new file to the output of `brew generate-cask-api` which
represents the new internal JSON v3 file. It involves removing
a bunch of unneeded hash keys while removing blank ones as well.

I've made some slight changes to the cask loader as well but more
might be necessary before this starts loading things correctly.
The full loader code will be added in a separate PR.
2024-03-07 20:29:58 -08:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Mike McQuaid
03e583e746
cask: read bundle version from Info.plist when sensible.
If you're trying to use `brew info --json=v2` to get an installed
version and figure out if it is outdated: you're going to have a bad
time with `auto_updates` casks because `installed_version` alone is not
enough to get the actually currently installed version of the app.

Instead, in these cases, try to read from `Info.plist` if there is one
and use that version.

While we're here, add a `blank?` method to `Version` so we can use it
for `present?` checks (making a `null?` `Version` object `blank?`).

Co-authored-by: Markus Reiter <me@reitermark.us>
2024-03-06 15:52:16 +00:00
Markus Reiter
c3c5437c4f
Rename Tap#reverse_cask_renames to Tap#cask_reverse_renames. 2024-03-01 12:57:37 +01: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
a3a1b4c253
Check tap migrations for renames. 2024-02-13 06:03:10 +01:00
Eric Knibbe
e63b1f4da5
docs: monospace suggested values 2024-02-04 15:42:26 +01:00
Bo Anderson
1c3c64a743
api: use freeze option for JSON parsing 2024-01-09 19:07:36 +00:00
apainintheneck
984dcf8c11 API: Load casks/formula from JSON with missing keys
We'd like to reduce the size of the API JSON and to do that we are
going to remove unused and/or blank elements from the cask/formula
definition. This will reduce the amount of data that has to go
over the wire and make it easier to load this data into memory.
2024-01-01 19:10:48 -08:00
Douglas Eichelberger
ffd761d2e9 Create dedicated Attrable mixin for attr_ methods 2023-12-28 11:46:27 -08:00