2100 Commits

Author SHA1 Message Date
Douglas Eichelberger
f6c7eb7124 Add hash/keys to extend/ 2024-01-19 13:36:17 -08:00
Issy Long
c63723bd7d
Merge pull request #16501 from issyl0/rubocop-new-rules-style-redundant-freeze
Fix RuboCop `Style/RedundantFreeze` offenses
2024-01-19 15:05:08 +00:00
Bevan Kay
bd6ab1d2b8
cask/uninstall: skip quit and signal directives when upgrading or reinstalling 2024-01-19 23:30:25 +11:00
Issy Long
f682147598
Fix RuboCop Style/RedundantFreeze offenses 2024-01-18 22:20:01 +00:00
Issy Long
0e27dc2564
Fix RuboCop Style/ArrayIntersect offenses 2024-01-18 14:11:43 +00:00
Patrick Linnane
3fdba532a2
various: fix miscellaneous typos
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-01-12 10:56:49 -08:00
Bo Anderson
1c3c64a743
api: use freeze option for JSON parsing 2024-01-09 19:07:36 +00:00
apainintheneck
926c5b739a cmd/audit: fix type error in cask livecheck url audit
This got updated recently in 42a42c96acc5193dbb6e321ff2aaecceb00e48a4
to split out the livecheck audits and as a result of that the type
signature for the #validate_url_for_https_availablity method got updated.

This did not account for the possibility that the livecheck url was nil.
I've added a nil check here since it makes no sense to try and validate
a nil url and we have nil checks for the other two http availability
audits already. Plus, the livecheck blocks are audited thoroughly already
for syntax.
2024-01-07 15:45:24 -08:00
Markus Reiter
d496d044f1
Split https_availability audit. 2024-01-06 11:40:56 +01: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
Douglas Eichelberger
caf8259ae6 Code review changes 2023-12-27 15:29:33 -08:00
Douglas Eichelberger
3abbf4447e Some minor regexp match perf improvements 2023-12-27 13:16:36 -08:00
Razvan Azamfirei
2dc3741f08
audit: fix formula path 2023-12-26 08:19:49 +02:00
apainintheneck
b79778229c Resolve Cask::Cask.all todo
Now it takes the :eval_all parameter that means we can remove
ARGV handling inside Cask::Cask.all.
2023-12-21 21:55:16 -08:00
apainintheneck
5a674c232f Fix Cask::Cask.all bug
We were only loading casks from files with this command which,
of course, didn't work for casks that can only be loaded from
the API (when the core cask tap is not tapped). This changes
things to align more with what we do for formulae.
2023-12-21 21:39:58 -08:00
Mike McQuaid
228b1d62ed
cask/artifact/abstract_uninstall: handle signal failures.
If the process is running as another user: this will always fail.
2023-12-20 19:43:46 +00:00
Patrick Linnane
9dee80cb2d
various: fix style errors 2023-12-18 09:34:01 -08:00
Rylan Polster
25b753fe51
Re-add some discontinued? checks for casks 2023-12-17 19:07:37 -05:00
Rylan Polster
4793677123
Merge pull request #16292 from Rylan12/cask-deprecate-disable
Add `deprecate!` and `disable!` to casks
2023-12-17 15:03:39 -05:00
Mike McQuaid
fb7f1a2c4d
Merge pull request #16349 from unshare/homepage-ua
Work around recent Akamai/Microsoft issues
2023-12-17 15:58:01 +00:00
Rylan Polster
c21b8bd68a
Fix deprecation message
Co-authored-by: Bo Anderson <mail@boanderson.me>
2023-12-16 23:10:20 -05:00
Rylan Polster
6431822e7b
Apply feedback 2023-12-16 20:18:35 -05:00
Rylan Polster
472dd95b16
Fix cask loading from the API
Co-authored-by: Kevin <apainintheneck@gmail.com>
2023-12-16 20:08:26 -05:00
Rylan Polster
40d3ab6a5d
Add tests and fix brew typecheck 2023-12-16 20:01:47 -05:00
Rylan Polster
7eb3f1a314
Replace discontinued? with deprecated? 2023-12-16 20:01:47 -05:00
Rylan Polster
641a80475e
Update cask logic to handle deprecations and disables 2023-12-16 20:01:47 -05:00
Rylan Polster
036723a668
Add deprecate! and disable! methods to the Cask DSL 2023-12-16 20:01:46 -05:00
Valentin Kulesh
06155ff6e0
Work around recent Akamai/Microsoft issues
At the moment, Microsoft Office and related casks fail audit due to
failure to fetch a product homepage from the main Microsoft site
(https://www.microsoft.com/) served by Akamai CDN.
The failure is severe and weird: no status code is received as the
connection is reset.
The analysis revealed the issue is linked to `User-Agent` and
`Accept-Language` headers parsing. Homebrew uses involved user agent
strings and has language hardcoded as `en`.
The simplest workaround is to use a simple user agent string when checking
homepage availability if the cask is in an audit exceptions list.

Merging this would fix Microsoft Office updates (including
https://github.com/Homebrew/homebrew-cask/pull/162671)
2023-12-16 22:20:17 +03:00
Issy Long
149b0e4f31
Fix new Style/MutableConstant RuboCop offenses for Ruby 3.1
- A follow-up to de592af20bbff5bcb548d2474f0722e59ff1129a, resetting the previous disabled comments too.
2023-12-16 11:57:06 +00:00
Issy Long
de592af20b
rubocop: Set TargetRubyVersion to 3.1 & disable all cops that fail
- As discussed in
  https://github.com/Homebrew/brew/pull/16337#issuecomment-1855668516,
  then we won't have the chicken/egg problem of fixing cops for syntax
  that's unsupported on Ruby 2.6 _before_ we set the TargetRubyVersion
  to 3.1, but if we set it too early then all the taps will fail.
2023-12-14 23:19:43 +00:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
Mike McQuaid
bd378a7b25
Merge pull request #16330 from MikeMcQuaid/untap_exceptions
cmd/untap: fix untapping syntax failure.
2023-12-13 14:09:44 +00:00
Mike McQuaid
beb9799265
cmd/untap: fix untapping syntax failure.
If an installed cask is invalid on attempting an untap: it will
prevent untapping that cask.

Fix this in two ways: one more specific to `untap` and one more
generally to other commands too:
- specific: only read the actual formulae/casks from the tap we're
  untapping instead of all of those that are installed
- general: rescue more exceptions in `Cask::Caskroom.casks` (like we
  already do for `Formula.installed`
2023-12-13 13:54:37 +00:00
Mike McQuaid
79a6091d08
Cask#full_name: properly output Homebrew org names
This was not returning the full name correctly for e.g. anything in
Homebrew/homebrew-fonts.

While we're here, fix up a few other places where `tap.core_cask_tap?`
can be used more appropriately.
2023-12-13 13:17:12 +00:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Sam Ford
491e2c4a80
Reorder #audit_min_os array for consistency
This change doesn't affect the behavior of the `#audit_min_os`
method and simply reorders the array members to place `plist_min_os`
before `sparkle_min_os` for the sake of consistency (using the same
order as the preceding lines).
2023-11-16 12:05:25 -05:00
Sam Ford
28451bd2bc
Use Sparkle sorting/filtering in #livecheck_min_os
The `#livecheck_min_os` cask audit method manually replicates some of
the `Sparkle` strategy's behavior but in an incomplete way that has
lead to inappropriate audit failures at times. This reimplements it
to use `Livecheck` methods, so it will align with the `Sparkle`
strategy's behavior.
2023-11-16 12:05:24 -05:00
Sam Ford
d376b46a7d
Skip items strategy blocks in #livecheck_min_os
The `#livecheck_min_os` cask audit method should be skipped when a
`Sparkle` `livecheck` block contains a `strategy` block that uses
the `items` argument (instead of `item`). These `strategy` blocks
contain arbitrary logic that ignores/overrides the strategy's sorting,
so we can't identify which item would be first/newest.
2023-11-16 12:05:24 -05:00
Bevan Kay
5f79980938
cask/url headers parameter type fix 2023-11-09 10:23:13 +11:00
Mike McQuaid
ff404fe5ab
Merge pull request #16184 from dduugg/rm-try
Remove use of ActiveSupport try
2023-11-06 13:11:01 +00:00
Mike McQuaid
d4bf3b0685
Merge pull request #16183 from dduugg/sorbet-updates
Sorbet updates for compatibility with recent releases
2023-11-06 13:10:12 +00:00
Razvan Azamfirei
df2aee4553
audit: add extract artifcats method 2023-11-05 17:18:32 -05:00
Razvan Azamfirei
e60523766e
audit: code review changes 2023-11-05 17:18:32 -05:00
Razvan Azamfirei
c90e6e7b4b
cask/audit: add audit_min_os 2023-11-05 17:18:31 -05:00
Douglas Eichelberger
75179e9239 brew style --fix 2023-11-05 12:18:31 -08:00
Douglas Eichelberger
00ba09d73d Remove use of ActiveSupport try 2023-11-05 09:28:19 -08:00
Douglas Eichelberger
0191af7899 resolve typecheck errors 2023-11-05 08:55:58 -08:00
Mike McQuaid
54012f14ce
cask: add installed_time to JSON output.
This is provided for formulae in `installed.time` and is useful to have
for casks as well as formulae so let's output it here too.
2023-11-03 11:37:01 +00:00
Edward
f21af1e3eb
fix: xattr check in download quarantine 2023-10-25 21:22:06 +08:00