3458 Commits

Author SHA1 Message Date
Issy Long
ee15435a90
Fix multiline hash key/value indentation 2025-05-21 14:31:58 +02:00
Mike McQuaid
c1a2f94e01
dev-cmd/tap-new: fix root_url warning.
Ruby couldn't detect the `root_url` usage inside the ERB template.
Instead, use interpolation so it can for a fixed warning and more concise
syntax.
2025-05-21 13:19:11 +01:00
Mike McQuaid
a94037a6ff
dev-cmd/update-maintainers: various fixes.
- install the `man` gem group for `kramdown` so
  `Manpages.regenerate_man_pages` can run successfully
- hardcode the non-organisation PLC members so that they aren't
  missing from the GitHub team
- correctly populate the PLC members again
2025-05-21 13:08:37 +01:00
Douglas Eichelberger
38bad25a86
Include annotations in typecheck updates 2025-05-20 20:56:53 -07:00
Bevan Kay
effb07ee76
bump-formula-pr: fix case when only url is provided 2025-05-20 21:23:52 +10:00
botantony
92832c258c
dev-cmd/create: add --cabal switch
Signed-off-by: botantony <antonsm21@gmail.com>
2025-05-18 20:18:34 +02:00
Eric Knibbe
2b8d104281
dev-cmd/generate-*-api: simulate latest macOS 2025-05-15 11:06:24 -04:00
Steve Peters
3dd87e6d17 dev-cmd/prof: require fileutils
Fixes error when running `brew prof`:
uninitialized constant Homebrew::DevCmd::Prof::FileUtils
2025-05-08 13:41:11 -07:00
botantony
18296808a2 dev-cmd/bump-*-pr: change autobump package message
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
botantony
562c104b7e dev-cmd/bump: replace --no-auto with --no-autobump
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
botantony
ad66e0c418 tap: get autobump list from formula/cask API
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
Alexander Bayandin
d60e72a055 dev-cmd/tap-new: use ERB templates instead of string interpolation 2025-04-28 23:57:44 +01:00
Alexander Bayandin
875702d51a dev-cmd/tap-new: support private repos 2025-04-28 18:07:19 +01:00
Bevan Kay
b255a670c0
bump-formula-pr: restore pr message 2025-04-23 14:45:15 +10:00
Patrick Linnane
5d8d453a90
Portable Ruby 3.4.3 2025-04-22 11:50:08 -07:00
Bevan Kay
2b132c0802
dev-cmd/bump-formula-pr: fix reference 2025-04-22 22:03:18 +10:00
Bevan Kay
c5a3879fdb
bump: bump synced formula together 2025-04-22 22:03:06 +10:00
Mike McQuaid
7873f0200f
Revert "bump: bump synced formula together" 2025-04-22 12:33:59 +01:00
Bevan Kay
7ccdc340a3
bump: bump synced formula together 2025-04-16 22:49:14 +10:00
Mike McQuaid
e98a052896
dev-cmd/edit: remove unneeded variable. 2025-04-11 16:07:29 +01:00
Anatoli Babenia
fff2c3ea79 edit: move no_env and no_install checks out of the loop 2025-04-11 17:21:17 +03:00
Anatoli Babenia
ccf506f7f9 brew style --fix 2025-04-11 17:15:55 +03:00
Anatoli Babenia
7523daaf33 edit: review fixes
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-04-11 17:15:55 +03:00
Anatoli Babenia
a0e68613f5 Fix false/Boolean type check
https://sorbet.org/docs/error-reference#7001
2025-04-11 17:15:55 +03:00
Anatoli Babenia
9bf4e620e0 edit: show --build-from-source only for formulas 2025-04-11 17:15:55 +03:00
Anatoli Babenia
fb5438bfd1 Update Library/Homebrew/dev-cmd/edit.rb
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-04-11 17:15:54 +03:00
Anatoli Babenia
fc0d7ac21d dev-cmd/edit: Actionable message about no API install 2025-04-11 17:15:54 +03:00
Rafael Gallani
ef13b69b03
dev-cmd/create: handle nil stdin 2025-04-11 08:48:54 +01:00
Bo Anderson
5ff37113ff
dev-cmd/vendor-gems: fix incorrect Bundler version being used 2025-04-09 19:35:13 +01:00
Sam Ford
99681d7fbc
bump-cask-pr: replace "host" naming with "current"
`Homebrew::SimulateSystem.current_os` may be returning the host OS or
a simulated OS and we can't be sure which in this context. At the
moment, this is expected to be the host OS but that may change in the
future. It shouldn't matter on a technical level but using "host" in
these variable names may lead to confusion.

This replaces "host" in names with "current", as it more accurately
describes the information.
2025-04-06 10:58:47 -04:00
Sam Ford
b7065d5fcf
bump-cask-pr: extract system_options generation
This extracts the logic for generating the `system_options` array in
the `replace_version_and_checksum` method into a separate
`generate_system_options` method. This logic is becoming more complex
(after recent changes) and manually testing it is a pain, so this
change is intended to allow us to add tests. The tests added here
provide 100% coverage for the method.
2025-04-06 10:58:46 -04:00
Sam Ford
6f06afbc11
bump-cask-pr: respect depends_on arch
This reworks the `SimulateSystem` args in the `bump-cask-pr`
`replace_version_and_checksum` method to respect `depends_on arch`
values in casks. That is to say, we shouldn't simulate Intel for a
cask using `depends_on arch: :arm64` and we shouldn't simulate ARM if
the cask uses `depends_on arch: :x86_64`.

In the process, this refactors how we collect/combine OS/arch values.
To make this approach work predictably, I removed the logic that
omits OS values matching the host OS (as `SimulateSystem` already
handles this). The `[{ os:, arch: }]` hash format only made sense when
we were omitting values, so this returns to the previous
`[[os, arch]]` array format (to align with the
`OnSystem::ALL_OS_ARCH_COMBINATIONS` array format).
2025-04-06 10:58:46 -04:00
Sam Ford
ed48426a33
tests: support :needs_arm, :needs_intel metadata
This adds the ability to specify tests that depend on a certain CPU
architecture using `:needs_arm` or `:needs_intel`, similar to the
existing `:needs_macos` and `:needs_linux` metadata for tests that
depend on a certain OS.
2025-04-04 09:17:32 -04:00
Sam Ford
612fec47f3
bump-cask-pr: rescue CaskUnreadableError
The `replace_version_and_checksum` method handles a `CaskInvalidError`
when loading a cask (handling casks that aren't valid on Linux) but
we can sometimes still encounter an error when bumping a cask with
on_system blocks. For example, bumping `displaylink` will produce a
`Cask 'displaylink' is unreadable: undefined method 'csv' for nil`
error when `SimulateSystem` runs as Linux, as the cask interpolates
`version.csv.first` in a `license` string but `version` isn't set on
Linux.

This adds `Cask::CaskUnreadableError` to the `rescue` arguments,
which accounts for this particular situation (allowing `displaylink`
to be bumped like before).
2025-04-03 17:56:48 -04:00
Sam Ford
38410f5432
bump-cask-pr: fix macOS host handling
`bump-cask-pr` was recently updated to add Linux support but the
change to the `replace_version_and_checksum` logic has broken the
command for casks that have on_system blocks that reference specific
macOS versions (e.g., `on_monterey :or_newer` in `logi-options+`).

The previous logic only simulated the arch, so the `current_os` value
on macOS was a specific version like `:sequoia`. The current logic
uses generic `:macos` values, which work for `on_macos` blocks but
don't work for blocks like `on_sequoia`, etc. This leads to an
`undefined method 'latest?' for nil` error, as `old_cask.version` is
`nil` in this scenario (i.e., none of the on_system blocks apply to
`:macos`, so `version` is never set).

This updates the method to only specify the OS in `system_options` if
the value doesn't align with the host (e.g., `:linux` on macOS),
which restores the previous behavior.

This also replaces `:macos` values with the newest macOS version
(e.g., `:sequoia`), so that `bump-cask-pr` on Linux can update casks
with on_system blocks that reference specific macOS versions. A
generic `:macos` value doesn't work with those on_system blocks, so
`version` is never called on Linux in that scenario but it works as
expected if we use the newest macOS value instead. This may not be
perfect but it brings `bump-cask-pr` a little closer to parity with
macOS on Linux.

Lastly, this skips `system_options` values where `old_cask` has no
version, as this means the cask doesn't apply to that OS/arch. We've
been seeing a related error on homebrew/cask autobump CI and this
guard should help to avoid it.
2025-04-03 17:56:47 -04:00
Mike McQuaid
8937beb3a1
Merge pull request #19688 from Homebrew/unbottled-linux-arch
dev-cmd/unbottled: check arch requirement on Linux
2025-04-03 15:11:49 +00:00
Michael Cho
053fa14fc2
dev-cmd/unbottled: check arch requirement on Linux 2025-04-03 10:01:07 -04:00
botantony
aa86fcc9b3
dev-cmd/bump: suggestions from MikeMcQuaid
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-02 17:23:09 +02:00
botantony
e3875f790e
dev-cmd/bump: add --no-auto flag
I do not like that `brew bump` command checks every single formula/cask,
even ones updated by BrewTestBot. Instead of showing useful info about
outdated packages, my terminal buffer is fludded with `Formula is
autobumped so will have bump PRs opened by BrewTestBot every ~3 hours`.
This flag excludes autobumped packages before checking them.

Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-02 16:44:44 +02:00
Patrick Linnane
39afba427e
Merge pull request #19670 from Homebrew/bump_warn_unofficial_taps
dev-cmd/bump-*: only warn on duplicate PRs for official taps.
2025-04-01 16:18:22 +00:00
Mike McQuaid
7250624b56
dev-cmd/bump-cask-pr: fix Linux cask bumping.
- Remove check for `cask.depends_on.macos` as it seems to be always
  present and set to at least >=10.11
- When we've specified multiple architectures, allow casks to be invalid
  on some architectures.
2025-04-01 12:07:16 +01:00
Mike McQuaid
108ecf9aac
dev-cmd/bump-*: only warn on duplicate PRs for official taps.
The default behaviour is too strict for unofficial taps. We can still
warn elsewhere but, given the potential for false positives, let's
loosen things a bit.
2025-04-01 11:01:17 +01:00
Sean Molenaar
faddb73204
Merge pull request #19510 from Homebrew/feat/bump-cask/on_linux
feat: add linux support to bump-cask-pr
2025-03-31 13:30:34 +00:00
Douglas Eichelberger
138eba20f8
Merge pull request #19618 from Homebrew/formula-url-getter
fix: Allow Formula.url with no args to get url
2025-03-28 17:31:45 +00:00
Douglas Eichelberger
e58486cd4c
fix: Allow Formula.url with no args to get url 2025-03-26 12:15:25 -07:00
Anatoli Babenia
202e52ded4
Update Library/Homebrew/dev-cmd/create.rb
Co-authored-by: Adrian Ho <the.gromgit@gmail.com>
2025-03-26 21:32:05 +03:00
Anatoli Babenia
901f9166f9 create: show command to install formula for testing 2025-03-26 21:12:00 +03:00
Mike McQuaid
1ce12ae6e5
Merge pull request #19575 from Homebrew/brew_bundle_filtering
Don't filter the environment for `brew bundle (exec|env|sh)`
2025-03-25 09:07:39 +00:00
Carlo Cabrera
40588b0ad9
dev-cmd/dispatch-build-bottle: support arm64 Linux
This will make it easier to dispatch bottle builds for arm64 Linux.
2025-03-25 11:03:37 +08:00
Mike McQuaid
6e20cedb67
Don't filter the environment for brew bundle (exec|env|sh)
It's both unexpected and undesirable for `brew bundle (exec|env|sh)` to
filter the environment and makes these tools less useful.

Not filtering the environment, though, causes issues with the
`brew bundle sh` shell. Fix this up and, while we're here, also improve
the formatting for both `zsh` and `bash` (the default) to use nicer and
more consistent prompts and colours.

To simplify this, consolidate some logic in a new
`Utils::Shell.shell_with_prompt` method and add tests for it and a
similar notice for `brew bundle sh`.

Finally, avoid printing out the notice when `HOMEBREW_NO_ENV_HINTS` is
set.
2025-03-24 13:37:25 +00:00