2291 Commits

Author SHA1 Message Date
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
botantony
ca447e1ce9 deprecate!/disable!: replacement_formula/replacement_cask fields
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-21 21:13:25 +02:00
botantony
e594e7e0bb deprecate!/disable!: allow to specify replacement type
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-21 21:13:25 +02:00
Bo Anderson
4cda5a1aa9
cask/artifact/abstract_flight_block: fix warning in Ruby 3.4 2025-04-16 17:06:59 +01:00
Sam Ford
97cce36779
Make os available in cask livecheck blocks
Casks now support an `os` DSL method, similar to `arch`. This makes
it available in `livecheck` blocks, like we do with `arch`.
2025-04-04 09:17:32 -04:00
Bevan Kay
4852829931
cask/audit: install container deps 2025-04-02 16:34:28 +11:00
Eric Knibbe
57f764a1d8 cask/api: remove control characters from cask caveats 2025-03-24 15:43:15 -04:00
Mike McQuaid
2a7c7511c3
cask/quarantine: tweak wording.
Co-authored-by: Eric Knibbe <enk3@outlook.com>
2025-03-20 18:07:30 +00:00
Mike McQuaid
10ad72c348
quarantine: allow skipping the app management permissions prompt.
If we know that we don't care about this prompt, let's allow setting
a variable to avoid alarming users.
2025-03-20 16:22:41 +00:00
Mike McQuaid
4a4aeca424
cask/download: avoid some checksum warnings.
These are always output in CI for e.g. `brew fetch google-chrome` and
are completely unactionable by the user.

Ultimately this is not disabling any security checks, it's just changing
when a warning is output and unifying the logic with the other similar
warning.
2025-03-19 12:45:50 +00:00
Douglas Eichelberger
c9a6bd6438
Merge pull request #19475 from Homebrew/typed-system-command
refactor: Enable strict typing in download_strategy
2025-03-14 22:34:17 +00: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
c48870080e
Incorporate feedback 2025-03-13 11:59:31 -07:00
Douglas Eichelberger
f183d0a398
Enable strict typing in Cask::URL 2025-03-12 19:09:52 -07:00
Douglas Eichelberger
e49a69679d
Enable strict typing in TopologicalHash 2025-03-12 19:09:52 -07:00
Douglas Eichelberger
1ca5299f40
refactor: Enable strict typing in download_strategy 2025-03-12 15:15:20 -07:00
Bevan Kay
74556fe97c
cask/utils: alllow use of @ in cask name 2025-03-12 19:57:37 +11:00
Eric Knibbe
cae1ca33ec
rmdir: ignore unreadable path errors 2025-03-11 09:48:39 -04:00
Eric Knibbe
c5ec1fa61b
cask/installer: pass more options to cask dependencies 2025-03-06 14:10:37 -05:00
Sam Ford
1ac70579eb
Cask: skip livecheck https audit for POST requests
We recently added `POST` request support to livecheck but related cask
checks are failing the `livecheck_https_availability` audit because it
calls `validate_url_for_https_availability` which calls
`Utils::Curl.curl_check_http_content` and that checks the URL using a
`GET` request. Adding `POST` request support to all of those methods
will take some work, so this adds a guard to skip the audit if the
`livecheck` block uses `post_form` or `post_json`. This isn't ideal
but it will allow us to add these `livecheck` blocks in the interim
time.

Co-authored-by: Douglas Eichelberger <d@eic.email>
2025-03-06 12:14:42 -05:00
Sean Molenaar
fc319f6793 feat: add tests for completion stanzas 2025-03-05 20:12:18 +01:00
Sean Molenaar
ab2b18f78c feat: add os_version for casks 2025-03-05 20:12:18 +01:00
Sean Molenaar
55b07d7fed feat: add cask shell completion 2025-03-05 20:12:18 +01:00
Douglas Eichelberger
fcf18912fe
Inline use of attr_predicate 2025-03-02 21:36:03 -08:00
Mike McQuaid
b1559f38a0
Add HOMEBREW_UPGRADE_GREEDY_CASKS
A space-separated list of casks. Homebrew will act as if `--greedy`
was passed when upgrading any cask on this list.
2025-02-25 15:34:49 +00:00
Sam Ford
a7cacfff1c
livecheck: refactor HEAD-only formula handling
The existing code for handling a `HEAD`-only formula involves two
return values that can be `nil` but this isn't apparent because the
related methods aren't typed. This adds type signatures to the
methods and updates the livecheck code to account for `nil` return
values (making it clear which methods can return `nil`).

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-02-20 22:39:18 -05:00
Douglas Eichelberger
cf635bc28a
Merge pull request #19314 from Homebrew/typed-dep-helpers
Enable strict typing in DependenciesHelpers
2025-02-18 18:47:06 +00:00
Douglas Eichelberger
8763fb6d29 Resolve rubocop violations 2025-02-17 18:56:31 -08:00
Sean Molenaar
22ed703c2b fix: use bottle naming for sha256
Signed-off-by: Sean Molenaar <smillerdev@me.com>
2025-02-17 14:30:44 +01:00
Rylan Polster
f874603a21 Add implicit macOS dependency to casks without explicit depends_on stanza 2025-02-17 14:30:44 +01:00
Sean Molenaar
a28fde1a8c fix sha256 on linux 2025-02-17 14:30:44 +01:00
Sean Molenaar
27a2d94c48 feat: allow zap on linux 2025-02-17 14:30:44 +01:00
Sean Molenaar
975fe8a83f feat: allow cask binaries on linux 2025-02-17 14:30:43 +01:00
Sean Molenaar
b2ca64b207 feat: allow linux blocks in casks 2025-02-17 14:27:38 +01:00
Douglas Eichelberger
0037b1f626 Enable strict typing in DependenciesHelpers 2025-02-16 12:24:22 -08:00
zyoshoka
20e33166e1
cask/url: remove arch placeholder when checking if unversioned
This prevents casks whose `url` contains only `#{arch}` from passing
`audit_sha256_no_check_if_unversioned`.
2025-02-14 15:14:40 +09: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
e227663207
cask/artifact/installer: don't reset uid if sudo is used.
This fixes handling `sudo` and EUID when using certain `script` commands
on casks e.g. adobe-creative-cloud.

Co-Authored-By: Bo Anderson <mail@boanderson.me>
2025-02-03 16:58:44 +01:00
Kristján Oddsson
3b0794a884 implement fixes and comments for DisableComment rubocop 2025-01-29 09:17:11 +00:00
Mike McQuaid
7ff99e2353
Use ~ instead of ${HOME}
Partial revert of Homebrew/brew#19153
See https://github.com/Homebrew/brew/pull/19153#discussion_r1930678587
2025-01-27 15:19:59 +00:00
Mike McQuaid
bbf5a9f479
env_config: use environment variables consistently
- use e.g. `$HOMEBREW_*` for cases where only the environment variable
  is the entire backtick-quoted string
- use e.g. `${HOMEBREW_*}` for cases where the environment variable is
  part of a backtick-quoted string to make clear what parts are variable
  and what parts are not
- use `export HOMEBREW_*=...` for cases where we're talking about
  setting the environment variable (because it likely needs to be
  exported to work how they want)

Inspired by https://github.com/Homebrew/homebrew-bundle/pull/1579 making
similar changes for Homebrew/homebrew-bundle.
2025-01-27 14:21:27 +00:00
Ilya Kulakov
730a3de1b9 sudo: Elevate priviliges before adding metadata after relocating a cask, if necessary
Homebrew cannot assume that target location is writable for chmod and xattr.
2025-01-20 14:35:36 -08:00
Sean Molenaar
c34b71655c feat: allow font install on linux
Apply suggestions from code review

Co-authored-by: Douglas Eichelberger <697964+dduugg@users.noreply.github.com>

feat: add linux appdir

Apply suggestions from code review

Co-authored-by: Douglas Eichelberger <697964+dduugg@users.noreply.github.com>
2025-01-19 11:14:24 +01:00
Sam Ford
cf22382921
Curl: use typed: strict
This upgrades `utils/curl.rb` to `typed: strict`, which requires
a number of changes to pass `brew typecheck`. The most
straightforward are adding type signatures to methods, adding type
annotations (e.g., `T.let`) to variables that need them, and ensuring
that methods always use the expected return type.

I had to refactor areas where we call a `Utils::Curl` method and use
array destructuring on a `SystemCommand::Result` return value
(e.g., `output, errors, status = curl_output(...)`), as Sorbet
doesn't understand implicit array conversion. As suggested by Markus,
I've switched these areas to use `#stdout`, `#stderr`, and `#status`.
This requires the use of an intermediate variable (`result`) in some
cases but this was a fairly straightforward substitution.

I also had to refactor how `Cask::URL::BlockDSL::PageWithURL` works.
It currently uses `page.extend PageWithURL` to add a `url` attribute
but this reworks it to subclass `SimpleDelegator` and use an
`initialize` method instead. This achieves the same goal but in a way
that Sorbet can understand.
2025-01-14 08:14:39 -05: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
Issy Long
6ada9a9665
Add clarifying comments to rubocop:disables
- Needed for PR 18842 that adds a `DisableComment` RuboCop to ensure that all RuboCop disables have comments.
2025-01-12 16:59:07 +00:00
Mike McQuaid
d490692b26
cask: fewer GitHub Actions warnings.
- don't care about no checksums being defined for official casks
- don't complain about Gatekeeper being disabled on GitHub Actions as
  it's been globally disabled for the team
2024-12-30 12:55:30 +00:00