Default ask mode for developers#22369
Open
MikeMcQuaid wants to merge 1 commit into
Open
Conversation
- Exercise the upcoming ask-by-default behaviour through `HOMEBREW_DEVELOPER` before the release. - Keep `HOMEBREW_NO_ASK` as the explicit opt-out while the transition is staged. - Document and enforce TTY-only confirmation prompts so non-interactive runs keep moving.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR stages “ask-by-default” behavior behind HOMEBREW_DEVELOPER, keeps HOMEBREW_NO_ASK as an explicit opt-out during the transition, and ensures confirmation prompts only occur when running interactively (TTY), so non-interactive runs continue without blocking.
Changes:
- Add a custom
Homebrew::EnvConfig.ask?implementation: enabled byHOMEBREW_ASKor (by default)HOMEBREW_DEVELOPER, disabled byHOMEBREW_NO_ASK, and only active when stdin/stdout are TTYs. - Enforce TTY-only confirmation prompting in
Homebrew::Install.ask_input. - Update documentation/manpages and shell completions to reflect the refined prompt rules; add/adjust tests covering the new behavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| manpages/brew.1 | Updates --ask, HOMEBREW_ASK, and HOMEBREW_NO_ASK documentation to match new prompting/default rules. |
| Library/Homebrew/test/env_config_spec.rb | Adds unit tests for the new EnvConfig.ask? semantics (developer default, NO_ASK opt-out, TTY gating). |
| Library/Homebrew/test/cmd/install_spec.rb | Updates/extends tests to cover TTY-only prompting behavior in Install.ask. |
| Library/Homebrew/install.rb | Skips confirmation prompting when stdin/stdout are not TTYs. |
| Library/Homebrew/env_config.rb | Implements custom ask? logic and wires HOMEBREW_ASK into custom implementations. |
| Library/Homebrew/cmd/upgrade.rb | Expands --ask help text to document prompt conditions and TTY behavior. |
| Library/Homebrew/cmd/reinstall.rb | Expands --ask help text to document prompt conditions and TTY behavior. |
| Library/Homebrew/cmd/install.rb | Expands --ask help text to document prompt conditions and TTY behavior. |
| docs/Manpage.md | Mirrors the manpage updates for --ask, HOMEBREW_ASK, and HOMEBREW_NO_ASK. |
| completions/zsh/_brew | Updates --ask completion descriptions to match the new rules. |
| completions/fish/brew.fish | Updates --ask completion descriptions to match the new rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HOMEBREW_DEVELOPERbefore the release.HOMEBREW_NO_ASKas the explicit opt-out while the transition is staged.brew lgtm(style, typechecking and tests) with your changes locally?OpenAI Codex 5.5 xhigh with local review and testing.