2079 Commits

Author SHA1 Message Date
Markus Reiter
4b432c7ea4
Explicitly mark non-private APIs. 2024-04-22 21:16:49 +02:00
Will Faught
4e7d128604 cmd, cask: info prints whether installed 2024-04-10 19:02:09 -07:00
Todd Schulman
827f475851 fix: dependencies message; empty formulae return
- All dependencies satisfied message applies to both formulae and casks.
- Trigger the empty formulae return condition only if formulae are present.
2024-04-09 01:50:29 -04:00
Mike McQuaid
8baed211a7
brew style --fix 2024-04-08 19:23:33 +01:00
Mike McQuaid
56fc9a1fb2
Merge pull request #17047 from Homebrew/block-params
Prefer numbered block params over proc conversion, cont'd
2024-04-08 19:13:01 +01:00
Douglas Eichelberger
c59d9fa833 Prefer numbered block params over proc conversion, cont'd 2024-04-08 09:47:27 -07:00
Mike McQuaid
1474806527
Add more HOMEBREW_FORBIDDEN_* configuration
We already had `HOMEBREW_FORBIDDEN_LICENSES` but this commit adds
`HOMEBREW_FORBIDDEN_CASKS`, `HOMEBREW_FORBIDDEN_FORMULAE` and
`HOMEBREW_FORBIDDEN_TAPS` for also forbidding those.

Relatedly, add `HOMEBREW_FORBIDDEN_OWNER` and
`HOMEBREW_FORBIDDEN_OWNER_CONTACT` to allow customising these
messages.

There were no existing tests for `HOMEBREW_FORBIDDEN_LICENSES` so have
added more tests for all of these checks.

Co-authored-by: Bo Anderson <mail@boanderson.me>
2024-04-08 16:38:32 +01:00
Bevan Kay
160e9d44dd
Revert "cask/audit: always enable codesign audit for casks" 2024-04-03 08:15:05 +11:00
Bevan Kay
038a3eb155
cask/audit: always enable codesign audit for casks 2024-04-02 21:53:07 +11:00
Mike McQuaid
7e35ae25d5
cask/utils: quieten down when fixing permissions fails.
When fixing permissions fails, we should not print the error messages
from e.g. `chmod` unless we are in debug or verbose mode (because we
immediately retry taking ownership `sudo`).
2024-04-01 16:22:42 +01:00
Bo Anderson
326bc3f889
Fix cask source checksum handling 2024-03-19 21:21:37 +00:00
Bo Anderson
011dfc8f45
cask/artifact/moved: fix permission handling when removing directories 2024-03-15 21:31:37 +00:00
Mike McQuaid
f1ba840193
Merge pull request #16889 from Homebrew/adopt_bundle_version
cask/artifact: check the bundle version when using `--adopt`.
2024-03-14 16:42:01 +00:00
Mike McQuaid
f086138043
Fix GitHub Actions annotation format.
Co-authored-by: Bo Anderson <mail@boanderson.me>
2024-03-14 14:09:11 +00:00
Mike McQuaid
a3702a28c4
cask/artifact: check the bundle version when using --adopt.
This makes `--adopt` considerably faster and more useful for application
bundles by checking the bundle version before failing to adopt the
bundle.

This could be further extended by e.g. checking if auto-updates are
enabled.

While we're here, also allow `adopt` to act a bit more like `force` in
a few other places assuming this initial check passes.
2024-03-14 10:31:31 +00:00
Mike McQuaid
dcaa69a2dc
Add GitHub Actions warning/error annotations for deprecations/disables.
This should make these messages, particular warnings, more obvious to
GitHub Actions users.

There's an argument perhaps we should do this more broadly for all
warning/error messages but: this feels like a good start.
2024-03-14 09:49:12 +00:00
Markus Reiter
e575671477
Actually remove FromDefaultNameLoader. 2024-03-12 22:50:13 +01:00
Mike McQuaid
b1990ed4b6
Merge pull request #16863 from apainintheneck/memoize-installed-tap-loading-v2
Memoize installed tap loading v2
2024-03-12 08:36:09 +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
Michael Cho
85a08bcdc4
cask/audit: allow @ for versioned casks
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-09 12:20:27 -05: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
9259c345cc
utils/analytics: general cleanup.
We have plans to add analytics for commands and `brew test-bot`

This requires a certain amount of refactoring which I've done here.

There was also a bunch of legacy `*_influx_?` usage from when we used
both InfluxDB and Google Analytics that made sense to clean up and
excessive indirection.
2024-03-07 15:19:04 +00:00
Markus Reiter
a24da6b072
Remove FromDefaultNameLoader to avoid warning twice. 2024-03-06 23:14:28 +01: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
a851bb86ef
Add type signature for Tap::fetch. 2024-03-06 14:30:17 +01:00
Mike McQuaid
c5e7282985
Merge pull request #16807 from dduugg/numbered-params
Prefer numbered block params over proc conversion
2024-03-04 16:38:14 +00:00
Douglas Eichelberger
c4db19232d git grep -lE '\(\&[A-Za-z._]+method\(:' | xargs gsed -i -E 's|\(\&([A-Za-z._]+)method\(:([a-z?_]+)\)\)| { \1\2(_1) }|g' 2024-03-03 18:55:56 -08:00
Douglas Eichelberger
90996e1997 git grep -lE '\(\&[A-Za-z._]+method\(:' | xargs gsed -i -E 's|\(\&([A-Za-z._]+)public_method\(:([a-z?_]+)\)\)| { \1\2(_1) }|g' 2024-03-03 18:55:32 -08:00
Bo Anderson
2d929b8a9f
cask/quarantine: avoid xcrun when executing Swift 2024-03-02 19:31:38 +00:00
Markus Reiter
c3c5437c4f
Rename Tap#reverse_cask_renames to Tap#cask_reverse_renames. 2024-03-01 12:57:37 +01:00
Mike McQuaid
f1eea64523
Merge pull request #16779 from reitermarkus/fix-load-from-path
Fix loading casks/formulae from relative paths.
2024-03-01 08:47:41 +00:00
Markus Reiter
3da0f8c4a6
Fix loading casks/formulae from relative paths. 2024-03-01 04:05:15 +01:00
Markus Reiter
755c8aecad
Simplify Tap#cask_files_by_name. 2024-02-29 22:47:43 +01:00
Bo Anderson
1d7101d8a3
Use HOMEBREW_TEMP more universally 2024-02-26 16:58:53 +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
670eb3d02d
Remove CaskLoader::tap_paths. 2024-02-20 18:25:11 +01:00
Markus Reiter
876535c670
Use HOMEBREW_DEFAULT_TAP_CASK_REGEX in FromDefaultNameLoader. 2024-02-13 21:52:45 +01:00
Markus Reiter
d506645667
Add separate loader for default tap. 2024-02-13 21:25:52 +01:00
Markus Reiter
a3a1b4c253
Check tap migrations for renames. 2024-02-13 06:03:10 +01:00
Markus Reiter
b4d602e70b
Don't warn about renamed installed casks. 2024-02-13 04:37:10 +01:00
Markus Reiter
eaf7b38995
Allow tap migrations with renames. 2024-02-13 04:17:43 +01:00
Markus Reiter
c39abef045
Always prefer default tap. 2024-02-12 21:45:07 +01:00
Markus Reiter
48c9897081
Convert FromNameLoader to class. 2024-02-12 07:43:29 +01:00
Markus Reiter
8e04ab8b42
Fix type signature. 2024-02-12 07:14:28 +01:00
Markus Reiter
0211feebd7
Fix loading test fixtures. 2024-02-12 07:14:27 +01:00
Markus Reiter
6f28392d6e
Remove FromDefaultTapPathLoader and FromDefaultTapLoader. 2024-02-12 07:12:33 +01:00