1648 Commits

Author SHA1 Message Date
Douglas Eichelberger
6a25de5daf
Rename formula_support to keg_only reason, refactor slightly 2025-08-24 14:57:19 -07:00
Mike McQuaid
a1f112f3fe
Move o* output methods to Utils::Output
This reduces the surface area of our `Kernel` monkeypatch and removes
the need to `include Kernel` in a bunch of modules.

While we're here, also move `Kernel#require?` to `Homebrew` and fully
scope the calls to it.
2025-08-20 19:20:19 +01:00
Eric Knibbe
b33443d655
Formula-Cookbook: document stable path variables 2025-08-19 09:04:12 -04:00
Rylan Polster
b04b0971a1
Enable loading stubbed formulae 2025-08-19 02:47:07 -04: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
copilot-swe-agent[bot]
42d4f3d8b9
Upgrade unlinked/unpinned kegs
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-08-15 19:18:52 +01:00
Issy Long
d7b59fdfe8
Merge pull request #20402 from Homebrew/head-url-must-always-specify-branch
Ensure that `head` Git URLs always specify a branch name
2025-08-13 07:47:21 +00:00
Ruoyu Zhong
40da6c1e16
formula: improve variable naming
`log_filename` sounds better than `logfn`.
2025-08-13 14:27:04 +08:00
Ruoyu Zhong
6f3f2d7317
formula: improve log filename handling
Fixes 718b82560a (commitcomment-163850325).
2025-08-12 22:46:41 +08:00
Rylan Polster
8dccdd8e60
Store formula API data for use in to_hash_with_variations 2025-08-11 22:06:07 -04:00
Carlo Cabrera
718b82560a
formula: append .log to formula build log filenames
Having log files with extensions like `.cc` and `.cmake` is really
unfriendly to editor syntax highlighters and language servers. Let's try
to make sure these are opened as log files by adding a `.log` extension
to them.
2025-08-11 13:10:14 +08:00
Issy Long
37eaed5bb7
Ensure that head Git URLs always specify a branch
- There's a TODO on the "someday" list [1] to ensure that `head` Git
  URLs always specify a branch.
- So I thought I'd automate this worry by adding an audit.
- Since `resource` block URLs tend to be pinned to SHAs, if indeed
  they are Git URLs, this audit only applies to `head` URLs.

[1]: https://github.com/orgs/Homebrew/projects/5?pane=issue&itemId=98789749
2025-08-10 20:28:50 +01:00
Eric Knibbe
626b6aca2d
RubyDoc output fixes 2025-08-05 17:13:42 -04:00
Eric Knibbe
6255263b51
output: express environment variables consistently 2025-08-04 09:50:06 -04:00
Carlo Cabrera
fb35add3b6
Replace ensure_formula_installed! with Formula#ensure_installed!
`ensure_formula_installed!` requires the `Formula` class to be loaded
before being called to work properly.

Let's guarantee that instead by implementing it as an instance method of
the `Formula` class.

See discussion at #20358.
2025-08-02 03:43:37 +08:00
Mike McQuaid
ec56bbf289
Improve extend/* Sorbet typing 2025-07-31 17:31:27 +01:00
Mike McQuaid
e3c3f5a356
Deprecate/disable/remove code for Homebrew 4.6
The next minor release will be Homebrew 4.6.0 so let's do the usual
deprecation/disable/remove code cycle.
2025-07-31 12:13:01 +01:00
Mike McQuaid
a3d6ee1d2a
Refactor DownloadQueue handling
- Use undocumented (for now) `HOMEBREW_DOWNLOAD_CONCURRENCY` instead
  of `--concurrency` flag and avoid passing around `concurrency`
- Create and use `Formula#enqueue_resources_and_patches` helper method
- Rename some method calls to be more obvious
- Use `Downloadable` type to simplify type checks
- General refactoring
2025-07-17 17:49:53 +01:00
Mike McQuaid
b87d2887fe
Merge pull request #20033 from tyuwags/master
Refine ask‐option dependency resolution and strengthen tests
2025-06-26 10:52:46 +00:00
Mike McQuaid
05c7b65f54
tab, cask/tab: add more Sorbet types and signatures.
I bailed before going all the way to `typed: strict` but this should at
least improve things and fix:

`Library/Homebrew/tab.rb:111: warning: The class Tab reached 8 shape variations, instance variables accesses will be slower and memory usage increased.`
2025-06-24 12:06:55 +01:00
thibhero
052c0ae2cd adding parameter to fetch quietly if wanted 2025-06-20 12:25:12 -04:00
Mike McQuaid
dc71b7c8f6
Cleanup extend/ directory usage.
- move some things out of `extend` that don't really fit there e.g.
  `Module`s that are included but not doing any
  overriding/monkeypatching
- move some code into `extend/os` to fix all remaining
  `rubocop:todo Homebrew/MoveToExtendOS`s
- remove some unneeded `bundle` skipper code that doesn't really make
  sense given our current bottling strategy
- extract some `Pathname` extensions to `extend/pathname` for separate
  files
- move a `ENV` `Kernel` extension into `kernel.rb`
- `odeprecate` a seemingly unused backwards compatibility method
- move `readline_nonblock` from a monkeypatch to a
  `ReadlineNonblock.read` method as its only used in one place
- fix up a link in documentation
2025-06-09 19:06:16 +01:00
Rylan Polster
c03f70f1dc
Refactor OnSystem and SimulateSystem bottle tag handling 2025-06-03 11:57:17 -04:00
Daeho Ro
24cd62140d
feat: add _ to powershell completion filename 2025-05-25 00:15:26 +09:00
Mike McQuaid
e33222b9c1
formula: remove unneeded attr_reader. 2025-04-30 16:42:29 +01:00
botantony
a10b635fe9 no_autobump!: suggestions from contributors and docs
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
botantony
79cf39fc1d formula/cask: add symbol support to no_autobump! method
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
botantony
5c032d3616 formula: fix JSON API generation for no_autobump! method
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
botantony
1fcacdc2dc formula/cask DSL: add no_autobump! method
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
Mike McQuaid
c9a7b62b1d
Homebrew 4.5 deprecations/disables/removals
The usual cycle of deprecating, disabling, and removing things in
Homebrew major/minor releases.
2025-04-22 17:15:23 +01:00
botantony
4fa1355be0 deprecate!/disable!: remove non-typed replacement field
Signed-off-by: botantony <antonsm21@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-04-21 21:13:25 +02:00
botantony
ca447e1ce9 deprecate!/disable!: replacement_formula/replacement_cask fields
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-21 21:13:25 +02:00
botantony
e594e7e0bb deprecate!/disable!: allow to specify replacement type
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-21 21:13:25 +02:00
Thierry Moisan
8211e0de85
shebang: include php language in formula 2025-04-09 12:32:08 -04:00
Mike McQuaid
c72386e3c3
bundle/commands/cleanup: correctly handle .keepme references.
Extract the relevant logic from `formula.rb`, moving to `keg.rb` and
then use this logic in `bundle/commands/cleanup.rb` to ensure that we
don't say we need to uninstall formulae that should be still kept.
2025-04-01 15:12:12 +01:00
Carlo Cabrera
b66c682dc6
formula: fix warning message grammar
The sentence needs a verb.
2025-04-01 17:19:57 +08:00
Douglas Eichelberger
e58486cd4c
fix: Allow Formula.url with no args to get url 2025-03-26 12:15:25 -07:00
botantony
96eacb7fd9
std_go_args: add -tags flag
Signed-off-by: botantony <antonsm21@gmail.com>
2025-03-16 21:41:19 +01:00
Mike McQuaid
805cd6f54f
formula: use any_installed_prefix for service paths
This fixes some edge cases where these paths cannot be found if a keg is
not linked.
2025-03-14 17:17:27 +00:00
botantony
bf7514f328
docs: add a bit more information about std_*_args to Formula Cookbook 2025-03-04 13:04:10 +01:00
Heath Stewart
222e8d129a
Document pwsh shell completion
Based on discussion in #19408, update the documentation to specify that `:pwsh` must be passed explicitly and that it will translate to a "powershell" argument, as is currently supported by Go's common `github.com/spf13/cobra` module and Rust's common `clap` (with `clap_complete`) crate.
2025-03-04 02:16:48 -08:00
Carlo Cabrera
807709622b
formula: remove pwsh from default completion shells
Fixes https://github.com/Homebrew/brew/pull/19407#issuecomment-2694083829
2025-03-03 20:07:13 +08:00
Mike McQuaid
e401eee162
Merge pull request #19407 from heaths/issue19403
Add PowerShell (pwsh) completion support
2025-03-03 08:31:03 +00:00
Douglas Eichelberger
fcf18912fe
Inline use of attr_predicate 2025-03-02 21:36:03 -08:00
Heath Stewart
15282dcdbd
Fix lint 2025-03-02 18:44:40 -08:00
Heath Stewart
42caf20fa4
Add PowerShell (pwsh) completion support
Resolves #19403
2025-03-02 18:17:38 -08:00
Douglas Eichelberger
19332ee1d5
Merge pull request #19383 from Homebrew/fix-yard-directives
docs: Remove misused YARD directives
2025-02-25 20:56:58 +00:00
Douglas Eichelberger
3b3c55ca0d
fix: Remove misused YARD directives 2025-02-25 11:55:37 -08:00
Douglas Eichelberger
a092403b16
Fix breaking type change in Formula#std_npm_args 2025-02-25 11:23:29 -08:00