Skip to content

Hide maintainer commands#22547

Merged
MikeMcQuaid merged 1 commit into
mainfrom
hide-maintainer-commands-manpage
Jun 5, 2026
Merged

Hide maintainer commands#22547
MikeMcQuaid merged 1 commit into
mainfrom
hide-maintainer-commands-manpage

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • Keep maintainer-only commands out of generated manpages.
  • Avoid top-level completion suggestions for those commands.
  • Preserve option completion after maintainers type the command.

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR.

OpenAI Codex 5.5 xhigh with local review and testing.


Copilot AI review requested due to automatic review settings June 5, 2026 08:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a hide_from_man_page! marker for maintainer-only/internal commands and updates manpage/completion generation so these commands are omitted from generated manpages and from top-level shell command suggestions, while still retaining option/argument completion once the command is explicitly typed.

Changes:

  • Mark specific dev-cmd commands as hidden from manpage generation (hide_from_man_page!) and regenerate docs/Manpage.md + manpages/brew.1 accordingly.
  • Update completion generation to suppress top-level suggestions for hidden commands (zsh/fish, plus cached command lists) while preserving per-command completion functions.
  • Add/extend tests to assert hidden commands are excluded from manpages and command suggestion lists, but still have argument completions.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
manpages/brew.1 Regenerated manpage output removing hidden maintainer command sections.
docs/Manpage.md Regenerated Markdown manpage output removing hidden maintainer command sections.
Library/Homebrew/completions.rb Adds hidden-command detection and omits hidden commands from zsh top-level suggestions; adjusts fish generation to drop command suggestions but keep arg completions.
Library/Homebrew/commands.rb Removes hide filtering from internal command discovery; filters hidden commands out of completion command lists.
Library/Homebrew/test/manpages_spec.rb Adds a test ensuring hidden commands don’t appear in generated manpage output.
Library/Homebrew/test/completions_spec.rb Adds tests asserting hidden commands keep argument completions (bash/zsh/fish behaviors).
Library/Homebrew/test/commands_spec.rb Adds tests asserting hidden commands are excluded from cached command lists (used for top-level suggestions).
Library/Homebrew/dev-cmd/dispatch-build-bottle.rb Marks command hidden from manpage generation.
Library/Homebrew/dev-cmd/formula-analytics.rb Marks command hidden from manpage generation.
Library/Homebrew/dev-cmd/generate-analytics-api.rb Marks command hidden from manpage generation.
Library/Homebrew/dev-cmd/generate-cask-api.rb Marks command hidden from manpage generation.
Library/Homebrew/dev-cmd/generate-formula-api.rb Marks command hidden from manpage generation.
Library/Homebrew/dev-cmd/generate-internal-api.rb Marks command hidden from manpage generation.
Library/Homebrew/dev-cmd/pr-automerge.rb Marks command hidden from manpage generation.
Library/Homebrew/dev-cmd/pr-publish.rb Marks command hidden from manpage generation.
Library/Homebrew/dev-cmd/pr-pull.rb Marks command hidden from manpage generation.
Library/Homebrew/dev-cmd/pr-upload.rb Marks command hidden from manpage generation.
Library/Homebrew/dev-cmd/release.rb Marks command hidden from manpage generation.
Library/Homebrew/dev-cmd/update-license-data.rb Marks command hidden from manpage generation.
Library/Homebrew/dev-cmd/update-maintainers.rb Marks command hidden from manpage generation.
Library/Homebrew/dev-cmd/update-sponsors.rb Marks command hidden from manpage generation.
completions/zsh/_brew Regenerated zsh completion file reflecting hidden-command omission from top-level suggestions while keeping functions.
completions/internal_commands_list.txt Regenerated internal command suggestion list with hidden commands removed.
completions/fish/brew.fish Regenerated fish completion file omitting command suggestions for hidden commands while keeping arg completions.
completions/bash/brew Regenerated bash completion file; top-level suggestions depend on updated cached/internal command lists.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Library/Homebrew/commands.rb
Comment thread Library/Homebrew/test/commands_spec.rb
Comment thread Library/Homebrew/test/commands_spec.rb
@github-code-quality
Copy link
Copy Markdown

github-code-quality Bot commented Jun 5, 2026

Code Coverage Overview

Languages: Ruby

Ruby / code-coverage/simplecov

The overall coverage in the branch remains at 78%, unchanged from the branch.

Show a code coverage summary of the most impacted files.
File c6a08de e2dc82e +/-
utils/tty.rb 92% 91% -1%
bundle/extensio...de_extension.rb 99% 98% -1%
download_queue.rb 74% 73% -1%
dev-cmd/release.rb 23% 23% 0%
dev-cmd/formula-analytics.rb 17% 18% +1%
dev-cmd/generat...nalytics-api.rb 22% 23% +1%
dev-cmd/pr-upload.rb 32% 33% +1%
manpages.rb 50% 54% +4%
services/cli.rb 62% 67% +5%
extend/pathname.rb 75% 82% +7%

Updated June 05, 2026 09:47 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

- Keep maintainer-only commands out of generated manpages.
- Gate their top-level completions behind `HOMEBREW_DEVELOPER`.
- Preserve option completion after maintainers type the command.
@MikeMcQuaid MikeMcQuaid force-pushed the hide-maintainer-commands-manpage branch from df0c288 to e2dc82e Compare June 5, 2026 09:29
@MikeMcQuaid MikeMcQuaid enabled auto-merge June 5, 2026 10:11
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jun 5, 2026
Merged via the queue into main with commit f66b2f6 Jun 5, 2026
39 checks passed
@MikeMcQuaid MikeMcQuaid deleted the hide-maintainer-commands-manpage branch June 5, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants