Skip to content

Conversation

@Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Jan 5, 2026

I noticed that we are calling brew regenerate-man-pages || true in CI, but this always fails because regenerate-man-pages isn't actually a command.

Instead, let's add a --no-exit-code option to generate-man-completions that will change the exit code behaviour to always be 0. Then, we can use this in the workflow to remove the || true and fail if the command itself actually fails.

Copilot AI review requested due to automatic review settings January 5, 2026 18:17
@Rylan12 Rylan12 force-pushed the add-generate-man-completions-no-exit-code branch from 9b852a1 to 875eaa3 Compare January 5, 2026 18:19
Copy link
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 adds a --no-exit-code flag to the generate-man-completions command to prevent it from exiting with a non-zero exit code when no changes are detected. This fixes an issue in CI where the wrong command (regenerate-man-pages) was being called with || true to suppress failures.

Key changes:

  • Added --no-exit-code switch to make the command always exit with code 0
  • Refactored exit code logic to conditionally call ofail based on the flag
  • Updated the docs workflow to use the correct command with the new flag

Reviewed changes

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

File Description
Library/Homebrew/dev-cmd/generate-man-completions.rb Added --no-exit-code switch and refactored exit code logic to honor the flag
Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/generate_man_completions.rbi Added Sorbet type signature for the new no_exit_code? method
.github/workflows/docs.yml Updated to use brew generate-man-completions --no-exit-code instead of the non-existent brew regenerate-man-pages || true
Files not reviewed (1)
  • Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/generate_man_completions.rbi: Language not supported

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

@Rylan12 Rylan12 enabled auto-merge January 5, 2026 18:20
Copy link
Member

@p-linnane p-linnane left a comment

Choose a reason for hiding this comment

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

Good catch!

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Whoops, my typo/code completion fail here! Thanks for fix.

@Rylan12 Rylan12 added this pull request to the merge queue Jan 6, 2026
Merged via the queue into main with commit b42f646 Jan 6, 2026
37 checks passed
@Rylan12 Rylan12 deleted the add-generate-man-completions-no-exit-code branch January 6, 2026 01:12
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