3519 Commits

Author SHA1 Message Date
Mike McQuaid
07091cfbea
Simplify pluralisation of common words
Formulae, dependencies, tries are all used in multiple places so let's
simplify them
2025-09-12 09:02:43 +01:00
Mike McQuaid
3d80dfadd1
dev-cmd/contributions: add --team flag.
This allows specifying an organisation team instead of an organisation
or individual users.
2025-09-11 11:36:48 +01:00
Mike McQuaid
a31fb2a6c2
Add additional brew contributions functionality.
- Add an `--organisation` flag to search a specific organisation.
- Wait for the GitHub API rate limit to reset before automatically
  retrying.
- Use (much) fewer API calls by using organisation-wide API PR searches
  rather than per-repository. This makes the rate limit easier to avoid
  and also makes things much faster (with the trade-off of showing a max
  PR count per-user rather than per-repository).
- Improve output to clarify when the max PR/commit count is reached.
- Move more logic and add more Sorbet signatures to the `GitHub` and
  `Utils::Git` modules.
- Rename a few GitHub API methods.
- Remove a lot of (now unused) `GitHub` module methods.
- Add, use a `Tap#full_repository` method.
- Add `formula-analytics` as a deprecated tap.
2025-09-10 15:32:06 +01:00
Douglas Eichelberger
6e6c06f5a9
Merge pull request #20643 from Homebrew/dug/typed-utils-bottles
Enable strict typing in Utils::Bottles
2025-09-08 18:03:39 +00:00
Douglas Eichelberger
b827a1337a
Enable strict typing in Utils::Bottles 2025-09-08 10:48:23 -07:00
Sam Ford
2f827242aa
bump: compare newer_than_upstream values to true
When `Enumerable#all?` is called without an argument, it should check
whether values are truthy but it doesn't appear to work as expected
for the `newer_than_upstream` hash. In this case,
`{ general: false }.all?` returns `true` when it seemingly should
return `false`. This is preventing autobump from opening PRs for new
versions, so I've updated related `all?` calls to use a block with an
explicit comparison to `true` as a workaround to fix autobump in the
immediate term.
2025-09-08 13:00:32 -04:00
Sam Ford
3541b4989f
bump: use LivecheckVersion for comparison
I recently modified `bump` to show the upstream version even when the
formula/cask version is newer (instead of an opaque `Unable to get
versions` error) but I noticed an issue while reviewing output from
a recent autobump run in homebrew/cask. This change works as expected
for versions with only one part (e.g., 1.2.3) but some multipart cask
versions (e.g., 1.5,15039) aren't being handled like they should
(where we split on commas and compare the version parts separately).
As a result, a cask version like 1.5,15039 is incorrectly seen as
newer than an upstream version like 1.5.1,15145 because 15039 from
the cask version is being compared to 1 in the upstream version.

This addresses the issue by using `LivecheckVersion` objects in the
related comparison, so versions will be handled as expected. This was
an oversight on my part but it only affects one cask at the moment
(`ia-presenter`), so it wasn't a widespread issue.
2025-09-08 10:30:57 -04:00
Sam Ford
b22d2328b7
bump: output lower upstream version
Currently `brew bump` will output `unable to get versions` for the
livecheck (or Repology) version if it's lower than the current
package version. This makes it impossible to distinguish between a
failing livecheck and one where the livecheck version is lower. We can
detect when the package version is newer than the upstream version but
`bump` doesn't do anything to handle the situation.

This addresses the issue by updating `bump` to display the lower
upstream version and flag the current version with a trailing "(newer
than upstream)" parenthetical to make the situation apparent (and so
we can easily search for this text in the output).
2025-09-05 16:24:59 -04:00
Eric Knibbe
1c4cb6936e
command options: various --eval-all fixes 2025-09-05 08:53:44 +01:00
Sam Ford
31cf8b43a9
livecheck: support trailing comments in watchlist
I ran `brew livecheck` today to check the packages in my watchlist
and realized that it wasn't checking one package because I had added
a trailing comment after the name (and `package # Comment` isn't a
valid package name). I thought we had added support for trailing
comments when we originally added comment support years back but I
must have been mistaken.

This adds support for trailing comments in livecheck watchlist files
as part of refactoring the watchlist line parsing logic to only use
one pass (instead of multiple `#map` and `#reject` calls). This
maintains the existing behavior, where blank lines and lines starting
with `#` are skipped, but does so in a more flexible manner. For
example, the existing logic wouldn't skip a comment line that has one
or more spaces before the `#` character but this new logic will
correctly skip it.
2025-09-03 09:10:58 -04:00
Bevan Kay
12ea343c9f
fix brew typecheck 2025-09-02 15:55:09 +08:00
Patrick Linnane
a8b4d115f2
brew style --fix
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2025-09-02 15:55:08 +08:00
copilot-swe-agent[bot]
f973bea35c
Remove obvious comments as requested in review
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-09-02 15:55:08 +08:00
copilot-swe-agent[bot]
ac6f770cdc
Address review feedback: fix description, use if/else, enable quarantine, improve fetch efficiency, and use local test cask
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-09-02 15:55:08 +08:00
copilot-swe-agent[bot]
6be546a5bc
Skip git logic for casks as they don't need it for patch creation
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-09-02 15:55:08 +08:00
copilot-swe-agent[bot]
88b7d2900a
Address fetching consistency concern and fix cask path handling
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-09-02 15:55:07 +08:00
copilot-swe-agent[bot]
a9cd0c4b5d
Add cask support to brew unpack command
Co-authored-by: p-linnane <105994585+p-linnane@users.noreply.github.com>
2025-09-02 15:55:07 +08:00
Douglas Eichelberger
240fd71e6f
Avoid repeated calls to affix checks 2025-08-31 11:11:41 -07:00
Mike McQuaid
12a31a1f6a
Merge pull request #20578 from Homebrew/dug/t-must-cleanup
Remove unnecessary use of `T.must`
2025-08-26 07:33:04 +00:00
Mike McQuaid
29518275d1
Merge pull request #20569 from Homebrew/bump-handle-skipped
bump: respect livecheck skipped status
2025-08-26 07:32:12 +00:00
Douglas Eichelberger
d97933b38c
Refactor T.must called on .first 2025-08-25 20:27:47 -07:00
Michael Cho
8b3b832e03
dev-cmd/pr-publish: default to main branch 2025-08-25 14:01:58 -04:00
Sam Ford
1d47038b12
bump: respect livecheck skipped status
`brew bump` understands that some formulae/casks are skipped by
livecheck but it doesn't use this information to avoid doing
unnecessary or inappropriate work. This modifies related logic to not
fetch PR information or try to open a version bump PR if livecheck is
skipped. livecheck is our only source of version information these
days, so we can't try to version bump a package if we don't have
upstream version information.

This has been leading to an "Invalid usage: `--version` must not be
empty" error and this _should_ fix the issue under these particular
circumstances. There's still plenty of room for improvement in how
all of this is handled in bump but this is just a quick bug fix.
2025-08-25 10:07:17 -04:00
Douglas Eichelberger
ceb2291be1
Enable strict typing in Kernel extensions + utils.rb 2025-08-23 18:44:36 -07:00
Mike McQuaid
c760afc66e
dev-cmd/bump: adjust system call.
Instead of immediately failing let's set `Homebrew.failed` to `true` to
set a non-zero exit code but continue with the rest of formulae/casks.
2025-08-22 15:54:51 +01:00
Mike McQuaid
621114488e
Add brew style --changed
This emulates `brew tests --changed` but for style checks. Should make
things a bit quicker for the case of wanting to quickly fix up
local files.
2025-08-22 14:33:20 +01:00
Mike McQuaid
7878c73b85
Merge pull request #20537 from Homebrew/dependabot/all-de17bcb037
Bump the "all" group with 2 updates across multiple ecosystems
2025-08-22 12:47:27 +00:00
Mike McQuaid
96230dc22b
dev-cmd/bump: fix system call.
This was using `system` instead of `safe_system` which ignores failures.
2025-08-22 13:06:31 +01:00
Mike McQuaid
02c2a348c4
brew style --fix 2025-08-22 10:41:43 +01:00
Mike McQuaid
e4e6185272
Merge pull request #20524 from Homebrew/fetch_api_files_refactoring
Refactor Homebrew::API.fetch_api_files! to not take arguments.
2025-08-20 15:26:44 +00:00
Mike McQuaid
d2de1d5b7d
Refactor Homebrew::API.fetch_api_files! to not take arguments.
Was thinking about this a bit and feels a bit nicer to DRY this up.
2025-08-20 08:51:11 +01:00
Justin Krehel
1f0ddcc791
formula-analytics: reduce noise from Linux builds
Frequent Linux builds add a number of low count unique OS variations to
analytics, so compress into a major version for displaying
2025-08-19 21:42:19 -04:00
Mike McQuaid
88d2b74ee5
dev-cmd/tests: fetch JSON API files if needed.
If HOMEBREW_NO_INSTALL_FROM_API was set, we hadn't fetched JSON API
files so will need to fetch them for a valid test environment.
2025-08-19 19:18:31 +01:00
Rylan Polster
4b4378943a
Fix formula-analytics pretty OS name logic 2025-08-19 03:12:32 -04:00
Mike McQuaid
1101689af2
Merge pull request #20500 from Homebrew/bump-pr-tap
dev-cmd/bump-*-pr: automatically tap core taps if needed.
2025-08-18 17:09:40 +00:00
Mike McQuaid
93807db8c2
dev-cmd/bump-*-pr: automatically tap core taps if needed.
If the tap isn't tapped already, automatically tap it.
2025-08-18 17:49:06 +01:00
Mike McQuaid
2dfc1b4eb8
Merge pull request #20498 from Homebrew/analytics_pretty_name
Move formula analytics pretty name logic to `MacOSVersion`.
2025-08-18 16:16:53 +00:00
Mike McQuaid
435158884d
Move formula analytics pretty name logic to MacOSVersion.
This makes sense to centralize these so when we support new macOS
versions we can just add them to the
`VERSIONS_TO_ANALYTICS_PRETTY_NAMES` hash.
2025-08-18 16:57:20 +01:00
Mike McQuaid
22fdb11e00
**/keg_relocate.rb: add set Sorbet typed: strict
Other files have been changed where required.
2025-08-18 15:02:15 +01:00
Carlo Cabrera
145c65d811
Merge remote-tracking branch 'origin/main' into stricter-brew-wrappers 2025-08-18 18:41:19 +08:00
Eric Knibbe
e021953db4
messages/comments: formatting fixes 2025-08-16 00:54:50 -04:00
Patrick Linnane
4d134f3aa1
formula-analytics: add macOS Tahoe
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2025-08-15 08:07:06 -07:00
Mike McQuaid
c2fbebb96d
Merge pull request #20420 from Homebrew/copilot/fix-19743
Implement selective path replacement for /usr/local to fix bottle creation issues
2025-08-13 15:42:49 +00:00
copilot-swe-agent[bot]
9328a55c54
Fix overzealous /usr/local prefix replacement
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-08-13 16:22:09 +01:00
Sam Ford
76a54d1455
bump-cask-pr: ensure new_cask has a url
We sometimes see errors like "attempted to use a `Downloadable`
without a URL!" in the homebrew/cask autobump workflow log because
`bump-cask-pr` can simulate Linux even if a cask doesn't support it,
leading to this error. This is something that should be resolved in
the future once I finally wrap up my related work to detect OS/arch
requirements but this adds a simple guard to address this in the
interim time.
2025-08-13 10:01:49 -04:00
Rylan Polster
0f9fb4f29a
Use API helper methods 2025-08-12 17:04:15 -04:00
Rylan Polster
5e2b54881c
Use hash for internal cask API 2025-08-11 15:03:05 -04:00
Rylan Polster
d3aac3fa5f
Include aliases, renames, and tap migrations in minimal APIs 2025-08-11 00:37:50 -04:00
Carlo Cabrera
a7c124c2d0
brew.sh: enforce HOMEBREW_FORCE_BREW_WRAPPER more strictly
`HOMEBREW_FORCE_BREW_WRAPPER` can be used as a security/compliance
feature, but allowing it to be disabled by setting
`HOMEBREW_NO_FORCE_BREW_WRAPPER` leaves a pretty large hole in it that
allows it to be sidestepped.

Let's fix that by actually checking the path of the process that called
`brew`, and the verify that that path matches the configured value of
`HOMEBREW_NO_FORCE_BREW_WRAPPER`.
2025-08-09 03:15:53 +08:00
Eric Knibbe
626b6aca2d
RubyDoc output fixes 2025-08-05 17:13:42 -04:00