4620 Commits

Author SHA1 Message Date
Mike McQuaid
365e554f67
Revert "rubocops: allow uses_from_macos openssl@3" 2021-09-09 09:16:59 +01:00
Mike McQuaid
a6e4e195c1
rubocops/lines: recommend on_os/OS.os? based on context.
Recommend the use of `on_macos` and `on_linux` unless we're in
`def install`, `def post_install` or `test do` in which case recommend
`OS.mac?` and `OS.linux?` instead.
2021-09-08 13:18:07 +01:00
Sam Ford
c4a91cdc95
Merge pull request #11972 from samford/fix-curl_args_options
Curl: Fix #curl_args options
2021-09-07 15:27:25 -04:00
Jonathan Chang
87f7db3b7d
Merge pull request #11994 from jonchang/openssl3
rubocops: allow uses_from_macos `openssl@3`
2021-09-07 11:52:34 -07:00
Mike McQuaid
f5a4214a70
Merge pull request #11956 from benpbolton/patch-1
Wrap mac 'brew info' multi-word service command parameters in single quotes
2021-09-07 19:43:06 +01:00
Jonathan Chang
d85559876e
tests: skip formulae exist check for openssl* 2021-09-07 11:33:27 -07:00
Sam Ford
d44979fa67
Curl#curl_args: Fix and refactor options 2021-09-07 14:13:17 -04:00
FnControlOption
eb16e10902 messages: record cask installations.
This is used to record installation times and also to determine
whether to display caveats.
2021-09-02 08:44:00 -07:00
Benjamin Bolton
87f5d98923
Add test for multi-word service argument warpping 2021-09-02 09:26:34 -06:00
Mike McQuaid
034d4ac82b
Merge pull request #11958 from Homebrew/remove_if_os_rubocop
rubocops/lines: remove OS.mac?/OS.linux? check.
2021-09-02 14:07:41 +01:00
Mike McQuaid
227a96fd7f
rubocops/lines: remove OS.mac?/OS.linux? check.
This will be reimplemented in https://github.com/Homebrew/brew/pull/11955
but this allows us to merge the homebrew-core changes before that PR is
merged.

Closes https://github.com/Homebrew/brew/pull/11946
2021-09-02 13:50:23 +01:00
Bo Anderson
9e42ddb011
sandbox: fallback to tput for winsize 2021-09-01 21:09:23 +01:00
Benjamin Bolton
632b96780f
Test for single-quote service wrapper 2021-09-01 11:54:38 -06:00
Rylan Polster
5d536d66fc
Rename HOMEBREW_JSON_CORE to HOMEBREW_INSTALL_FROM_API 2021-08-27 00:24:15 -04:00
Rylan Polster
8690d661fd
Merge pull request #11859 from Rylan12/cask-json
Allow casks to be installed using the `cask-source` API
2021-08-26 23:58:51 -04:00
Rylan Polster
e08d5f113c
Make Homebrew::API::Versions#latest_cask_version tests macOS-only 2021-08-26 23:35:33 -04:00
Rylan Polster
186c839525
Fix tests 2021-08-26 23:21:48 -04:00
FnControlOption
326321c1fd cli/parser: allow commands that look like options 2021-08-25 14:34:57 -07:00
Rylan Polster
c3a8b3841e
Only include differring versions
Move the resetting of `MacOS.version` to an `ensure` block.

Fix the tests by adding a test OS and new fixture that has a
different version for that test OS.
2021-08-25 10:30:38 -04:00
Sam Ford
e65c9d02ab
PageMatch: Expand #find_versions tests 2021-08-19 16:07:53 -04:00
Sam Ford
26821301e7
livecheck: move url/regex generation into methods 2021-08-17 18:03:40 -04:00
Sam Ford
13b349b4ae
Refactor #find_versions parameters in strategies 2021-08-16 12:01:32 -04:00
Rylan Polster
c32223a89c
Add cask-source API 2021-08-14 01:59:04 -04:00
Sam Ford
7e07010f06
Improve standardization of strategy tests 2021-08-11 19:05:59 -04:00
Sam Ford
56dd89114d
Standardize valid strategy block return types
Valid `strategy` block return types currently vary between
strategies. Some only accept a string whereas others accept a string
or array of strings. [`strategy` blocks also accept a `nil` return
(to simplify early returns) but this was already standardized across
strategies.]

While some strategies only identify one version by default (where a
string is an appropriate return type), it could be that a strategy
block identifies more than one version. In this situation, the
strategy would need to be modified to accept (and work with) an
array from a `strategy` block.

Rather than waiting for this to become a problem, this modifies all
strategies to standardize on allowing `strategy` blocks to return a
string or array of strings (even if only one of these is currently
used in practice). Standardizing valid return types helps to further
simplify the mental model for `strategy` blocks and reduce cognitive
load.

This commit extracts related logic from `#find_versions` into
methods like `#versions_from_content`, which is conceptually similar
to `PageMatch#page_matches` (renamed to `#versions_from_content`
for consistency). This allows us to write tests for the related code
without having to make network requests (or stub them) at this point.
In general, this also helps to better align the structure of
strategies and how the various `#find_versions` methods work with
versions.

There's still more planned work to be done here but this is a step
in the right direction.
2021-08-11 19:05:57 -04:00
Bo Anderson
9686ebe355
os/mac/diagnostic: prevent some double diagostic failures 2021-08-11 14:19:22 +01:00
Rylan Polster
90bbe8bb03
Merge pull request #11831 from Rylan12/api-cleanup
Refactor API methods
2021-08-09 12:32:55 -04:00
Rylan Polster
ab8aea0652
Fix tests 2021-08-09 11:00:00 -04:00
Connor Mann
ed7066c183
Style fix 2021-08-06 22:35:16 -04:00
Connor Mann
1581a29b28
Update tests 2021-08-06 22:34:30 -04:00
Rylan Polster
a8c03c1cc6
Restrict HOMEBREW_JSON_CORE use in tests 2021-08-06 11:52:21 -04:00
Rylan Polster
b1215800d4
Fix tests 2021-08-06 11:42:55 -04:00
Rylan Polster
2afbd38dde
Remove extra comment 2021-08-06 04:35:45 -04:00
Rylan Polster
737dd1654b
Refactor API methods 2021-08-06 04:31:27 -04:00
Connor Mann
3dde12c634
Handle only HEAD kegs in to_latest_kegs 2021-08-04 18:51:39 -04:00
Sam Ford
a970780851
livecheck: allow nil return from strategy blocks 2021-08-02 18:33:34 -04:00
Sam Ford
ddde0f7589
livecheck: allow inheriting from a formula/cask 2021-08-02 09:12:22 -04:00
Sean Molenaar
869b0ea519
Formula: use opt_prefix for service helpers 2021-07-26 11:11:34 +02:00
Rylan Polster
b18bbacced
Merge pull request #11714 from Rylan12/developer
Add `brew developer` command
2021-07-21 09:53:04 -04:00
Rylan Polster
27ba803bb5
Remove need for HOMEBREW_NO_DEV_CMD_MESSAGE 2021-07-20 11:47:31 -04:00
Adrian Ho
a14d8924de extract: ignore syntax errors during load 2021-07-20 09:57:04 +08:00
Rylan Polster
41b0bf7bbb
Add developer command 2021-07-14 01:55:00 -04:00
Rylan Polster
e344cb6aff
Merge pull request #11648 from Rylan12/homebrew-json
Install formulae from JSON files
2021-07-13 02:54:49 -04:00
Rylan Polster
1973e72015
BottleAPI: fix tests 2021-07-13 02:29:03 -04:00
Rylan Polster
68c2be5c17
BottleAPI: add tests 2021-07-12 03:03:29 -04:00
Mike McQuaid
5659d74ff5
Merge pull request #11646 from chenrui333/add-test-epub
fixtures: add test.epub
2021-07-09 17:15:25 +01:00
Rui Chen
b28f14aac2 fixtures: add test.epub
Signed-off-by: Rui Chen <rui@chenrui.dev>
2021-07-09 11:39:58 -04:00
Nanda H Krishna
5ccfbcd1d2
Autocorrect style issues with brew style --fix 2021-07-08 12:36:39 +05:30
Mike McQuaid
1680ddb267
utils/repology: temporarily disable functionality.
Doesn't work with system `curl` currently.
2021-06-30 09:20:56 +01:00
Mike McQuaid
a4c2e0e1b3
Tweak BuildPulse/rspec-retry logic
BuildPulse is trying to find flaky tests for us but, given the previous
model of using `rspec-retry`, it would rarely find them. Instead, let's
try to always rerun `brew tests` multiple times, report to BuildPulse
each time (by moving the reporting logic into `brew tests`) and disable
`rspec-retry` when using BuildPulse.

While we're here, let's enable `rspec-retry` locally so we don't have
flaky tests biting maintainers/contributors there.
2021-06-29 12:43:47 +01:00