Skip to content

Conversation

@daeho-ro
Copy link
Member

  • 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?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

This is based on #21287, .

While working on shell completion support, I noticed that when the same packages e.g. cobra, click and clap, are used across mutiple formulae, providing parameter formats with default shells makes the user experience much simpler.

So the goal of this PR is to improve readability by extracting some logic into private methods, and to simplify the DSL by providing more predefined types like :cobra and re-organize the order of shell parameter formats alphabetically.

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.

Looks good thanks again!

Base automatically changed from feature/typer-completion to main December 21, 2025 08:32
@daeho-ro daeho-ro marked this pull request as ready for review December 21, 2025 08:44
Copilot AI review requested due to automatic review settings December 21, 2025 08:44
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 refactors the generate_completions_from_executable method to improve code maintainability and adds support for the :cobra shell completion format. The refactoring extracts the shell parameter generation logic into a private method and introduces format-specific default shell lists.

Key Changes:

  • Added :cobra shell parameter format with default shells including PowerShell
  • Refactored shell parameter generation logic into private completion_shell_parameter method
  • Reorganized documentation examples alphabetically by format type

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

@daeho-ro daeho-ro force-pushed the feature/improve-completions branch 2 times, most recently from 36aa804 to c5d7dca Compare December 21, 2025 11:01
@daeho-ro
Copy link
Member Author

I have noticed that the powershell change can break the current status, so keep it same as original.

@daeho-ro daeho-ro force-pushed the feature/improve-completions branch from c5d7dca to 92455a0 Compare December 21, 2025 11:01
@daeho-ro daeho-ro force-pushed the feature/improve-completions branch from 92455a0 to 2037f08 Compare December 22, 2025 10:07
@daeho-ro daeho-ro force-pushed the feature/improve-completions branch from 2037f08 to 37187f0 Compare December 22, 2025 10:08
@daeho-ro
Copy link
Member Author

The impact of changes now minimized (maybe same as before) and so we I think we can merge this.

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.

Thanks again!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Dec 23, 2025
Merged via the queue into main with commit 1107c99 Dec 23, 2025
73 of 77 checks passed
@MikeMcQuaid MikeMcQuaid deleted the feature/improve-completions branch December 23, 2025 16:09
@p-linnane
Copy link
Member

Thanks for this @daeho-ro! Great work and glad to see all the Homebrew/core PRs adding this!

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