chore: use ./bin/brew instead of system brew

This commit is contained in:
Shaan Majid
2026-02-26 01:12:54 -06:00
parent 36bd496f76
commit c8e0f5250d
3 changed files with 16 additions and 16 deletions
+3 -3
View File
@@ -6,11 +6,11 @@
"hooks": [
{
"type": "command",
"command": "brew style --changed --fix"
"command": "./bin/brew style --changed --fix"
},
{
"type": "command",
"command": "brew typecheck"
"command": "./bin/brew typecheck"
}
]
}
@@ -20,7 +20,7 @@
"hooks": [
{
"type": "command",
"command": "brew tests --changed",
"command": "./bin/brew tests --changed",
"timeout": 360
}
]
+3 -3
View File
@@ -3,15 +3,15 @@
"hooks": {
"afterFileEdit": [
{
"command": "brew style --changed --fix"
"command": "./bin/brew style --changed --fix"
},
{
"command": "brew typecheck"
"command": "./bin/brew typecheck"
}
],
"stop": [
{
"command": "brew tests --changed"
"command": "./bin/brew tests --changed"
}
]
}
+10 -10
View File
@@ -1,6 +1,6 @@
# Agent Instructions for Homebrew/brew
Most importantly, run `brew lgtm` to verify any file edits before prompting for input to run all style checks and tests.
Most importantly, run `./bin/brew lgtm` to verify any file edits before prompting for input to run all style checks and tests.
This is a Ruby based repository with Bash scripts for faster execution.
It is primarily responsible for providing the `brew` command for the Homebrew package manager.
@@ -10,18 +10,18 @@ Please follow these guidelines when contributing:
### Required Before Each Commit
- Run `brew typecheck` to verify types are declared correctly using Sorbet.
- Run `./bin/brew typecheck` to verify types are declared correctly using Sorbet.
Individual files/directories cannot be checked.
`brew typecheck` is fast enough to just be run globally every time.
- Run `brew style --fix --changed` to lint code formatting using RuboCop.
Individual files can be checked/fixed by passing them as arguments e.g. `brew style --fix Library/Homebrew/cmd/reinstall.rb``
- Run `brew tests --online --changed` to ensure that RSpec unit tests are passing (although some online tests may be flaky so can be ignored if they pass on a rerun).
Individual test files can be passed with `--only` e.g. to test `Library/Homebrew/cmd/reinstall.rb` with `Library/Homebrew/test/cmd/reinstall_spec.rb` run `brew tests --only=cmd/reinstall`.
`./bin/brew typecheck` is fast enough to just be run globally every time.
- Run `./bin/brew style --fix --changed` to lint code formatting using RuboCop.
Individual files can be checked/fixed by passing them as arguments e.g. `./bin/brew style --fix Library/Homebrew/cmd/reinstall.rb``
- Run `./bin/brew tests --online --changed` to ensure that RSpec unit tests are passing (although some online tests may be flaky so can be ignored if they pass on a rerun).
Individual test files can be passed with `--only` e.g. to test `Library/Homebrew/cmd/reinstall.rb` with `Library/Homebrew/test/cmd/reinstall_spec.rb` run `./bin/brew tests --only=cmd/reinstall`.
- All of the above can be run with the `brew-mcp-server`
### Sandbox Setup
- When working in a sandboxed environment e.g. OpenAI Codex, copy the contents of `$(brew --cache)/api/` to a writable location inside the repository (for example, `tmp/cache/api/`) and `export HOMEBREW_CACHE` to that writable directory before running `brew tests`. This avoids permission errors when the suite tries to write API cache or runtime logs.
- When working in a sandboxed environment e.g. OpenAI Codex, copy the contents of `$(./bin/brew --cache)/api/` to a writable location inside the repository (for example, `tmp/cache/api/`) and `export HOMEBREW_CACHE` to that writable directory before running `./bin/brew tests`. This avoids permission errors when the suite tries to write API cache or runtime logs.
### Development Flow
@@ -33,14 +33,14 @@ Please follow these guidelines when contributing:
## Repository Structure
- `bin/brew`: Homebrew's `brew` command main Bash entry point script
- `completions/`: Generated shell (`bash`/`fish`/`zsh`) completion files. Don't edit directly, regenerate with `brew generate-man-completions`
- `completions/`: Generated shell (`bash`/`fish`/`zsh`) completion files. Don't edit directly, regenerate with `./bin/brew generate-man-completions`
- `Library/Homebrew/`: Homebrew's core Ruby (with a little bash) logic.
- `Library/Homebrew/bundle/`: Homebrew's `brew bundle` command.
- `Library/Homebrew/cask/`: Homebrew's Cask classes and DSL.
- `Library/Homebrew/extend/os/`: Homebrew's OS-specific (i.e. macOS or Linux) class extension logic.
- `Library/Homebrew/formula.rb`: Homebrew's Formula class and DSL.
- `docs/`: Documentation for Homebrew users, contributors and maintainers. Consult these for best practices and help.
- `manpages/`: Generated `man` documentation files. Don't edit directly, regenerate with `brew generate-man-completions`
- `manpages/`: Generated `man` documentation files. Don't edit directly, regenerate with `./bin/brew generate-man-completions`
- `package/`: Files to generate the macOS `.pkg` file.
## Key Guidelines