4691 Commits

Author SHA1 Message Date
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
Tom Forbes
173e6bf1d3 Fix tests 2022-12-10 15:02:18 +00:00
Michael Cho
776d6b934d
language/python: optionally link manpages 2022-12-08 17:03:59 -08:00
EricFromCanada
8f445de261
dev-cmd/create: also prompt for name with --cask 2022-12-06 13:04:51 -05:00
Sean Molenaar
855a2b8096
Merge pull request #14209 from SMillerDev/feature/caveats/respect_require_root
caveats: print sudo in caveats if service requires it
2022-12-06 13:06:03 +01:00
Mike McQuaid
3070fd7fef
Merge pull request #14206 from apainintheneck/make-formula-default-on-linux
Make :formula? the default on Linux
2022-12-06 11:29:16 +00:00
Sam Ford
e56735a171
ElectronBuilder: Allow Date/Time deserialization
The `ElectronBuilder` strategy uses `YAML#safe_load` to parse YAML
content and this limits deserialization to appropriate classes. We
recently encountered a `Tried to load unspecified class: Time` error
when using the `ElectronBuilder` strategy on a `latest-mac.yml` file
containing `releaseDate: 2022-12-01T02:02:46.419Z`.

The electron-builder YAML files we usually encounter use single
quotes around the `releaseDate` value to ensure it's treated as a
string (e.g., `releaseDate: '2022-10-12T17:55:26.718Z'`) and this is
what we do in `electron_builder_spec.rb`. The aforementioned YAML
file doesn't use single quotes around the value, so it's treated as
a timestamp and apparently this makes Psych use `Time` (which
`#safe_load` doesn't allow by default).

Seeing as we can't control the YAML content and there's a chance we
may encounter other files like this in the future, this commit
modifies the related `#safe_load` call to allow `Time` (and `Date`
for good measure). This will resolve the aforementioned error and
allow the `ElectronBuilder` strategy to work as expected in this
scenario.
2022-12-05 21:45:18 -05:00
Sean Molenaar
0cd10ed65e
caveats: print sudo in caveats if service requires it 2022-12-05 12:12:51 +01:00
apainintheneck
35500130c4 Update parser tests
- Remove named_args linux specs now that that
  logic has been moved to the parser
2022-12-04 23:02:44 -08:00
Bevan Kay
96574c831f
fix tests 2022-12-05 15:20:45 +11:00
apainintheneck
b7e28ef48f Make :formula? the default on Linux
This makes :formula? the default whenever
defined throughout the codebase on Linux.
It also makes :cask? illegal for all Linux
users.
2022-12-04 19:43:12 -08:00
Bevan Kay
40fd8f7d78
unversioned_cask_checker: check installer artifacts 2022-12-05 14:26:38 +11:00
Tim Visher
fc31d5560c livecheck/strategy/sparkle.rb: Add macos to the candidate os values list
As can be seen by TextExpander's Sparkle Feed, `macos` is a possible
value.

```
$ date -u '+%FT%T%z' && xmlstarlet sel -t -v '//rss//channel//item//enclosure/@*[name()="url" or name()="sparkle:version" or name()="sparkle:shortVersionString" or name()="sparkle:os"]' <(curl --location --silent https://textexpander.com/appcast/TextExpander-macOS.xml)
2022-10-22T17:07:06+0000
https://cdn.textexpander.com/mac/731.2/TextExpander_7.3.1.dmg
731.2
7.3.1
macos
https://cdn.textexpander.com/mac/720.16/TextExpander_7.2.dmg
720.16
7.2
macos
https://cdn.textexpander.com/mac/710.6/TextExpander_7.1.dmg
710.6
7.1
macos
https://cdn.textexpander.com/mac/702.2/TextExpander_7.0.2.dmg
702.2
7.0.2
macos
https://cdn.textexpander.com/mac/701.2/TextExpander_7.0.1.dmg
701.2
7.0.1
macos
https://cdn.textexpander.com/mac/700.33/TextExpander_7.0.dmg
700.33
7.0
macos
https://cdn.textexpander.com/mac/685.6/TextExpander_6.8.5.zip
685.6
6.8.5
https://cdn.textexpander.com/mac/684.8/TextExpander_6.8.4.zip
684.8
6.8.4
https://cdn.textexpander.com/mac/683.2/TextExpander_6.8.3.zip
683.2
6.8.3
https://cdn.textexpander.com/mac/682.10/TextExpander_6.8.2.zip
682.10
6.8.2
https://cdn.textexpander.com/mac/681.3/TextExpander_6.8.1.zip
681.3
6.8.1
https://cdn.textexpander.com/mac/680.30/TextExpander_6.8.zip
680.30
6.8
https://cdn.textexpander.com/mac/TextExpander_6.5.6.zip
656.3
6.5.6
https://cdn.textexpander.com/mac/TextExpander_6.5.5.zip
655.0
6.5.5
https://cdn.textexpander.com/mac/TextExpander_6.5.4.zip
654.3
6.5.4
https://cdn.textexpander.com/mac/TextExpander_6.5.3.zip
653.3
6.5.3
https://cdn.textexpander.com/mac/TextExpander_6.5.2.zip
652.0
6.5.2
https://smilesoftware.com/downloads/test/TextExpander_6.5.1.zip
651.5
6.5.1
```

Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
2022-12-04 14:21:27 -05:00
apainintheneck
00990e34a7 Merge branch 'master' into create-cop-for-os-checks 2022-11-29 23:14:15 -08:00
apainintheneck
c477b9aab3 Cleanup after adding os specific rubocop
- Change name of rubocop warning
- Disable linting on remaining offending lines
- Add todos to move lines with disabled linting
  checks to extend/os in the future
2022-11-29 23:13:50 -08:00
Frederick Zhang
c27eed4606
Curl: Fix following redirections when base changes
Update base URL when there is an absolute location, so that following
relative locations are considered relative to the new base.

Consider below cURL output for https://example_one.com:

    HTTP/1.1 302 Moved Temporarily
    Location: https://example_two.com

    HTTP/1.1 302 Moved Temporarily
    Location: /foo/

    HTTP/1.1 200 OK

The final URL should be https://example_two.com/foo/ rather than
https://example_one.com/foo/.
2022-11-30 01:32:24 +11:00
Mike McQuaid
49bacd681e
diagnostic: remove some checks.
- Some of these are currently failing globally on GitHub Actions.
- Some(/all?) of these predate our use of the macOS sandbox,
  environment filtering, PATH filtering and pushing users much harder to
  use bottles instead of building from source
- I haven't seen a case for a long time where any of these actually
  debugged a user issue. If/when this happens: we can add a given check
  back.
- This should allow us to dramatically reduce the amount of cleanup
  that `brew test-bot` needs to do on GitHub Actions.
2022-11-29 09:21:34 +00:00
apainintheneck
c7d53a2d9c Add cop to police os checks
The methods `OS.linux?` and `OS.mac?` should only be used
in `extend/os` and this cop makes sure of that.
2022-11-19 22:01:13 -08:00
apainintheneck
2601cc410b Only optimize for the core tap 2022-11-17 21:15:43 -08:00
Mike McQuaid
59f4b5226a
tests: test on Ubuntu 18.04. 2022-11-09 14:45:43 +00:00
Sean Molenaar
d477d1663a
Service: add method to define a root requirement 2022-11-06 13:52:53 +01:00
Bo Anderson
e7b47bc34e
test: sort metadata alphabetically 2022-11-05 16:51:33 +00:00
Bo Anderson
7d7083d0f3
Universally apply Ruby disable options 2022-11-05 01:58:12 +00:00
Issy Long
6f2f97b98f
test/rubocops/formula_desc: Ensure autocorrect when desc ends in .
- This was another thing that I should have done in PR 3411 in 2017,
  tested that the regex for autocorrecting `desc` stanzas ending in full
  stops actually worked. At least I'm getting to it now.
2022-11-03 23:13:19 +00:00
Issy Long
f3d43110b5
test/rubocops/formula_desc: Ensure that desc allows ending with etc.
- This was funny (and embarrassing), I was looking at my first contributions to
  Homebrew since someone asked me how long I'd been involved.
- Turns out that in 2017 I improved the formula description RuboCop rule to
  allow descriptions to end with `etc.` in
  https://github.com/Homebrew/brew/pull/3411. Apparently I didn't have time
  back then to write a test for it. So now I will remedy this 5 years later.
2022-11-03 22:25:07 +00: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
4f4747cf98
Merge pull request #14014 from Bo98/ruby3-part2
Additional fixes for Ruby 3 compatibility
2022-10-20 16:17:01 +01:00
Mike McQuaid
bfd2263425
integration_test: fix Bundler deprecation.
Otherwise in some configurations some tests will fail.
2022-10-20 13:33:27 +01:00
Mike McQuaid
416af82670
macOS Ventura (and related) test fixes
- fix `check_for_config_scripts` test, no idea why this wasn't working
- don't autoretry tests if `focus` or `byebug` are enabled
- add a ARM64 Ventura bottle symlink
2022-10-20 11:28:27 +01:00
Bo Anderson
eac32f0b20
Additional fixes for Ruby 3 compatibility 2022-10-18 01:54:59 +01:00
Bo Anderson
9b99594753
Preliminary compatibility fixes for Ruby 3 2022-10-11 02:53:27 +01:00
Dawid Dziurla
38026e6d8d
test: update for default.target 2022-10-07 20:22:13 +02:00
Bo Anderson
af234779af
test: support non-master init.defaultbranch 2022-10-07 18:44:03 +01:00
Mike McQuaid
c49f2e8b4c
Merge pull request #13941 from apainintheneck/default-no-casks-on-linux
Warn linux users about using --cask
2022-10-04 09:39:28 +01:00
apainintheneck
a178fc6a88 Cleanup no cask on linux specs 2022-10-02 08:51:17 -07:00
apainintheneck
5d27b70757 Set --formula by default on linux 2022-10-01 17:28:07 -07:00
apainintheneck
020c50e588 Warn linux users about using --cask 2022-10-01 16:11:39 -07:00
Sam Ford
40b0070beb
Modify comments and other text
The `check_for_resources` code arguably speaks for itself, so it
doesn't feel like a necessary addition. Besides that, this cleans up
some other comments and text to better align with existing examples.
2022-09-27 00:18:20 -04:00
Mohammad Zain Abbas
42d8c852ae
Merge branch 'Homebrew:master' into mohammad 2022-09-25 03:09:36 +02:00
Mohammad Zain Abbas
03c372ef52 Minor fixes 2022-09-25 02:06:23 +02:00
Rylan Polster
f66b5ff208
Include test deps when loading a formula from the API 2022-09-21 02:53:58 -04:00
Mohammad Zain Abbas
5b1397d44d
Merge branch 'Homebrew:master' into mohammad 2022-09-18 02:48:29 +02: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
Mike McQuaid
1b3f5980be
Merge pull request #13839 from apainintheneck/no-autoremove-build-deps-when-built-from-src
autoremove: ignore build deps when built from src
2022-09-14 13:10:14 +01:00
apainintheneck
f068f74f55 Move autoremove code to util and add tests 2022-09-13 23:23:48 -07:00
Mohammad Zain Abbas
e058da1706 Merge branch 'master' into mohammad 2022-09-14 05:19:50 +02:00
Sean Molenaar
ff54095b8a
Cask: automatically add cask audits
This reverts commit 16618374653dc5461dd971e8ed1992188cc3803d.
2022-09-13 11:19:33 +02:00