631 Commits

Author SHA1 Message Date
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
Bo Anderson
aebc125e9c
cask: support url specs in API 2023-02-24 13:56:46 +00:00
Mike McQuaid
f280ce069b
Support loading formulae/casks from subdirectories
Previously, we required all formulae and casks to be in a specific
formula or cask directory but did not check any subdirectories.

This commit allows using subdirectories for official taps, the only
ones likely to be big enough to warrant sharding in this way and to
avoid potentially breaking backwards compatibility for existing taps.

This was inspired by the most recent issues with homebrew-cask.
2023-02-24 10:57:41 +00:00
Mike McQuaid
d7029e95cd
Merge pull request #14769 from dduugg/enable-types
Enable typing in Cask::Artifact
2023-02-23 18:02:44 +00:00
Bo Anderson
e663f532a6
Checksum Ruby source file downloads 2023-02-22 22:50:24 +00:00
Douglas Eichelberger
29c6baeed1 Enable typing in Cask::Artifact 2023-02-22 09:11:29 -08:00
Issy Long
298bb65dfb
rubocop: Entirely disable Metrics cops
- These are arbitrary length limits that had a load of disables in code.
- The limits were only increasing over time rather than decreasing.
- Fixing the problematic code to be shorter would take a long time for
  questionable gain since the problem has been around so long.
2023-02-21 00:34:17 +00:00
Issy Long
f8654bd363
rubocop: In-line disables of Metrics/{Module,Block,Class}Length
- We're not going to make the really long things be any shorter any time soon.
- The instructions in issue 14685 say, pragmatically, "disable all the rubocop
  rules we're never going to realistically fix e.g. Metrics/ClassLength". But
  that felt like a slippery slope to more _really_ long modules/classes/blocks,
  and the limits are here for a reason.
2023-02-19 16:33:23 +00:00
apainintheneck
3eede57ba2 ::FromAPILoader tests for cask 2023-02-16 19:35:34 -08:00
Mike McQuaid
08c6b4556d
Merge pull request #14616 from reitermarkus/audit-cask-version
Add audit for versions containing colons or slashes.
2023-02-15 11:59:59 +00:00
Bo Anderson
6e1b9ddb49
test/cask/cask_spec: fix test 2023-02-15 04:59:07 +00:00
Mike McQuaid
237eec8ef8
Overhaul Formula/Cask JSON generation
- Use constants for placeholders
- Monkeypatch to set `HOMEBREW_PREFIX` consistently to placeholder
- Use environment variable to set `Dir.home` consistently to placeholder
- Use `appdir` short-circuit to set `Cask#appdir` consistently to placeholder
- Use `Cask.generating_hash!` to enable "generating mode" with these patches
- Fix `Formula#caveats` from JSON

Fixes #14505
Fixes #14595
2023-02-14 14:19:40 +00:00
apainintheneck
39c6f7d6fb Stop including *flight block source in cask API
Originally we were going to try and load the *flight blocks from the API
but we ended up going with downloading the caskfile for the subset of
casks that need this functionality for consisty's sake.

This reverts the following commits from most recent to oldest:
- ffc74a51fb32b66a4cd8bc41dbd076dd23d9100e
- e5616e94fe42505434c330be35eeafef2739944f
- d1490c3d5c087d00f2bca1787cce331202b195c5
- 7ca5a5d9a71a73f21bbb8555a38048f027bee89b
- 2d5d132713d0701d02d5ff33e9918812d13d2a83

It also changes how *flight blocks are handled in `.to_h`.
Essentially, when *flight blocks exist they are just included
as a hash of the artifact to nil to indicate that they exist.

More information isn't necessary since we don't evaluate
the current source code in the *flight artifacts that
we get from the API.
2023-02-13 21:22:18 -08:00
Markus Reiter
cd18703582
Add audit for versions containing colons or slashes. 2023-02-14 02:08:56 +01:00
Markus Reiter
b821a00bc5
Pass only and except to cask audits. 2023-02-08 08:38:32 +01:00
Mike McQuaid
1c1c1623e2
test/cask/cmd/list: add tap_git_head. 2023-02-02 12:19:44 +00:00
Rylan Polster
f38ac3943f
Fix tests 2023-01-28 02:39:23 -06:00
Luca Ongaro
490679da45 Improve test 2023-01-25 00:19:37 +01:00
Luca Ongaro
1fc1c82aed Fix code style and add tests 2023-01-25 00:08:15 +01:00
Mike McQuaid
f22f3eaa0b
Merge pull request #14400 from dduugg/rspec-cop-fix
Resolve RSpec/VerifiedDoubles todos
2023-01-23 13:36:37 +00:00
Douglas Eichelberger
a83623e4cf Resolve cask/pkg_spec violation 2023-01-22 17:09:55 -08:00
Douglas Eichelberger
585098a9b9 Resolve cask/installer_spec violation 2023-01-22 17:09:55 -08:00
Douglas Eichelberger
357807fbac Resolve cask/artifact/pkg_spec violation 2023-01-22 17:09:55 -08:00
Alexander Regueiro
b2b7072fbe Permit multiple uninstall stanzas in casks (temp)
Longer-term solution is described [here](https://github.com/Homebrew/brew/issues/14365#issuecomment-1398214354).
2023-01-21 18:45:58 +00:00
Ilya Kulakov
3d16112b14 cask: fix writability check backing up an artifact 2023-01-13 15:30:14 -08:00
Douglas Eichelberger
b4ed7b9924 Add tests 2023-01-11 09:04:09 -08:00
Rylan Polster
7ca5a5d9a7
Simplify require "method_source" calls 2023-01-02 17:41:36 -05:00
Rylan Polster
2d5d132713
Include *flight block source in cask API 2023-01-02 14:33:33 -05:00
Mike McQuaid
5994f165f5
Merge pull request #14123 from bevanjkay/cask-wildcard-launchctl
cask/artifact/abstract_uninstall: allow wildcard entries for launchctl
2022-12-29 19:26:53 +00:00
Bevan Kay
3bdab156c2
add additional test 2022-12-29 12:54:21 +11:00
Bevan Kay
db9d48a7ec
fix tests 2022-12-28 12:50:16 +11:00
Bevan Kay
01f865f93a
update test 2022-12-19 14:35:31 +11:00
Mike McQuaid
77c0d38c35
brew style --fix 2022-12-13 11:37:06 +00:00
Bevan Kay
e8e6ee30b4
add initial tests 2022-12-13 00:00:43 +11:00
Ian Gregory
a715dec49d Add --adopt switch
Allows `brew install` & co. to adopt existing cask artifacts that are
identical to those being installed.

Discussion: #14006
2022-10-21 23:28:51 -04:00
Bo Anderson
eac32f0b20
Additional fixes for Ruby 3 compatibility 2022-10-18 01:54:59 +01:00
Sean Molenaar
67c6cae6a0
Merge pull request #13857 from SMillerDev/feature/cask/auto_audit
Cask: automatically add cask audits
2022-09-15 16:27:07 +02:00
Sean Molenaar
f049e90e41
audit_spec: style fix 2022-09-15 15:33:25 +02:00
Sean Molenaar
5697ca79b1
audit_spec: limit stanza check 2022-09-15 15:27:43 +02:00
Sean Molenaar
ff54095b8a
Cask: automatically add cask audits
This reverts commit 16618374653dc5461dd971e8ed1992188cc3803d.
2022-09-13 11:19:33 +02:00
Mike McQuaid
7349c2b996
brew style --fix 2022-09-13 09:43:09 +01:00
Mike McQuaid
1661837465
Revert "Cask: automatically add cask audits" 2022-09-06 11:46:40 +01:00
Sean Molenaar
86f011cefb
Cask: automatically add cask audits 2022-08-29 11:28:20 +02:00
Rylan Polster
5c7e7eebe4
Condense artifact entries
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2022-08-25 10:24:30 -04:00
Rylan Polster
90d22bc7b1
Include dsl key in cask artifact hash 2022-08-25 03:04:48 -04:00
Rylan Polster
fcb30c1ead
Merge pull request #13702 from Rylan12/sha256-arch
Add `arm:` and `intel:` arguments to cask `sha256` stanza
2022-08-17 10:34:04 -04:00
Sean Molenaar
cc61a759ed
Merge pull request #13627 from SMillerDev/feature/cask/signing_check
cask: add audit for incorrect signing
2022-08-16 10:51:59 +02:00
Rylan Polster
686e02b7ce
Add arm: and intel: arguments to cask sha256 stanza 2022-08-16 00:48:24 -04:00
fn ⌃ ⌥
783fcfb97c Fix tests 2022-08-15 07:52:32 -07:00
Sean Molenaar
e90371f8ab
cask: add audit for incorrect signing 2022-08-11 09:11:29 +02:00