559 Commits

Author SHA1 Message Date
Markus Reiter
bdd6523ce8
Deprecate appcast. 2023-03-30 03:29:06 +02:00
apainintheneck
6ccf21c2c9 Merge branch 'master' into add-service-block-to-formula-api 2023-03-22 20:06:32 -07:00
apainintheneck
801ee5e474 Address feedback
- style nits
- better comments for tests that are not idempotent
- moved appdir placeholder constant to global.rb
2023-03-22 19:43:49 -07:00
apainintheneck
38146893c3 api_hashable: Make API path subs generic
This turns the ability to replace common paths with placeholders
into a mixin that can be used with both Casks and Formulae.

The idea here is to make formula hash generation more consistent.
2023-03-21 23:20:42 -07:00
Mike McQuaid
c31ae1ce6a
Merge pull request #14948 from hyuraku/remove-cask/cmd/fetch
remove `cask/cmd/fetch`
2023-03-19 17:21:22 -04:00
Issy Long
865e99c611
test/cask: Rename 'expected_json_ventura' since it's >= Ventura
- Let's actually show in the fixtures JSON filename what's changed
  between the two.
2023-03-18 15:16:23 +00:00
Issy Long
6b4b923b44
test/cask: Fix "System Settings" caveats for (non-)Ventura OSes
- "System Preferences" was updated to be "System Settings" in macOS
  Ventura. This naming was updated in our caveats generator in PR 14997.
- This test was failing for me locally (on Ventura) because it was
  hardcoded to expect `System Preferences => Security & Privacy`, but
  getting `System Settings => Privacy & Security`.
- This is not the most important thing in the world, we can probably
  live with the failing test, but I thought I'd try to fix it anyway.
2023-03-18 13:19:20 +00:00
hyuraku
da6f48dbd0
Merge branch 'master' into move-cask/cmd/uninstall 2023-03-12 11:49:06 +09:00
hyuraku
08560e04ae remove cask/cmd/fetch_spec 2023-03-11 22:13:00 +09:00
hyuraku
e321edabbc remove options and comments 2023-03-11 21:15:24 +09:00
hyuraku
cd0686d75b move cask/cmd/uninstall_spec to cask/uninstall_spec 2023-03-09 22:33:45 +09:00
hyuraku
38a62b3a51 repair style 2023-03-09 20:55:33 +09:00
hyuraku
2f870fa670 move cask/cmd/upgrade_spec to cask/upgrade 2023-03-09 20:41:22 +09:00
Issy Long
3a83b5492c
rubocop: Clean up Style/BlockDelimiters excludes and autofix offenses
- The defaults of using "do ... end" for multi-line blocks everywhere is
  good, better than switching everything to braces everywhere.
2023-03-08 23:54:22 +00:00
hyuraku
122b24e9ff repair zap spec 2023-03-06 22:27:54 +09:00
hyuraku
e0416e0f65 add zap option spec to cask_installer spec 2023-03-06 22:27:53 +09:00
hyuraku
7c1bd961c6 remove cask/cmd/zap and cask/cmd/zap_spec 2023-03-06 22:27:53 +09:00
Issy Long
734a651f93
rubocop: Enable Layout/MultilineMethodCallIndentation & fix offenses
- Part of trying to reduce the number of `Excludes:` we have in our
  RuboCop configs.
- The fixes here all seemed reasonable, with some minimal tweaks for
  line length and less floatiness. Apart from `test/dev-cmd/bottle_spec.rb`
  where RuboCop wanted to do some ridiculously floaty indentation and there
  wasn't an obvious alternative place to break the lines, so I opted for
  in-line disables instead.
2023-03-03 22:18:51 +00:00
hyuraku
931ff309c7 move cask/cmd/list_spec to cask/list_spec 2023-03-02 21:53:15 +09:00
Mike McQuaid
cae7aad141
Merge pull request #14713 from apainintheneck/cask-to-h-without-api
cask: `to_h` without api
2023-03-01 12:34:41 +00:00
Mike McQuaid
9296db0c41
Merge pull request #14839 from hyuraku/move-cask/cmd/info-to-cask/info
Move `cask/cmd/info` to `cask/info`
2023-03-01 12:25:26 +00:00
apainintheneck
9087afba74 Add baseline test for Cask#to_h
Also, added a test for loading JSON files in the cask loader.
2023-02-28 21:43:02 -08:00
apainintheneck
c19017c6bd Make Cask#to_h work without the API
Set metadata when we load casks from the source API.

Set `@tap_git_head` manually.

Also, allow `auto_update` to receive false.
This is only done for consistency.

Stop double printing the `kext` caveat.

Handle Array elements correctly when substituting
path elements in artifacts. This affected how the
Uninstall Signal keys were evaluated (they are
represented as arrays of arrays).
2023-02-28 19:36:20 -08:00
hyuraku
198c6f6b8c move cask/cmd/info_spec to cask/info_spec 2023-03-01 00:01:28 +09:00
Mike McQuaid
eeadcc8ded
Merge pull request #14632 from bevanjkay/cask-sample-languages-audit
cask/auditor: only audit 10 languages by default on casks with many languages
2023-02-28 12:16:51 +00:00
Bevan Kay
d1b09a90da
cask/auditor: only audit 10 languages by default on casks with many languages 2023-02-28 18:54:27 +11:00
apainintheneck
9af04fdf38 Add installer tests 2023-02-26 11:26:44 -08:00
apainintheneck
fd62cdf636 cask: delay loading from source API
For casks with certain stanzas, *flight and language
stanzas in this case, we need to use the caskfile
to install them correctly. The JSON API is not an option.

This delays loading from the source API until just before
we try to install one of these casks. This reduces the
number of requests we make to the source API.
2023-02-25 20:54:37 -08:00
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