Skip to content

Comments

Add Homebrew formula#49

Open
cboone wants to merge 9 commits intofacebookincubator:mainfrom
cboone:feature/add-homebrew-formula-to-click-style-completions
Open

Add Homebrew formula#49
cboone wants to merge 9 commits intofacebookincubator:mainfrom
cboone:feature/add-homebrew-formula-to-click-style-completions

Conversation

@cboone
Copy link
Contributor

@cboone cboone commented Jan 19, 2026

This replaces #44. This time it's built on #48, so as not to confuse Copilot unnecessarily. Once that PR is merged or closed, I'll clean this one up.

This time I had to temporarily downgrade the version in Cargo.toml so that it matches the names of the released binaries. Once you release updates, I can pull that commit out.

My notes from last time:

Thanks for scrut! It's fantastic.

I saw your note in the docs about Homebrew installation coming soon, so I made a simple formula (and updated the docs). I have no idea if this is actually how you intend to handle the installation (is there a better repo for the formula?), but thought I'd send it along in case it works for you.

I'm happy to make any helpful changes, just let me know. Specifically, if it's helpful to have a script or task or something to update the formula when you push a new release, I can add that. Just give me an idea of how to proceed.

@meta-cla meta-cla bot added the cla signed label Jan 19, 2026
@cboone cboone marked this pull request as ready for review January 19, 2026 18:58
Copilot AI review requested due to automatic review settings January 19, 2026 18:58
@cboone cboone mentioned this pull request Jan 19, 2026
Copy link

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 Homebrew installation support for Scrut, including shell completion generation functionality. The changes enable users to install Scrut via Homebrew with automatic completion setup for Bash, Fish, PowerShell, and Zsh.

Changes:

  • Added Homebrew formula with platform-specific binary installation for macOS and Linux
  • Implemented shell completion generation using the _SCRUT_COMPLETE environment variable
  • Updated documentation with Homebrew installation instructions and shell completion usage guide

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Formula/scrut.rb New Homebrew formula that downloads pre-built binaries and generates shell completions during installation
src/bin/main.rs Added completion generation logic triggered by _SCRUT_COMPLETE environment variable
website/docs/getting-started/installation.md Updated installation docs with Homebrew instructions and shell completion guide
selftest/commands/completions.md Added tests for shell completion functionality across Bash, Zsh, and Fish
Cargo.toml Added clap_complete dependency and temporarily downgraded version to match released binaries

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

…sh completions

Add test cases for PowerShell and Elvish shell completions to ensure
they generate the expected completion scripts with subcommands.

Add installation instructions showing how to configure completions in
PowerShell profiles and Elvish rc.elv configuration files.
@cboone cboone force-pushed the feature/add-homebrew-formula-to-click-style-completions branch from be21640 to 7972012 Compare January 19, 2026 19:22
@cboone
Copy link
Contributor Author

cboone commented Jan 19, 2026

Updated to appease Copilot.

Copy link

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

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.


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

Copy link

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

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.


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

@cboone cboone force-pushed the feature/add-homebrew-formula-to-click-style-completions branch from a71b99b to b920649 Compare January 19, 2026 19:42
@cboone cboone requested a review from Copilot January 19, 2026 19:43
Copy link

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

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.


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

end

test do
assert_match "scrut #{version}", shell_output("#{bin}/scrut --version")
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

The test assertion should include the 'v' prefix to match the actual version output format. According to the installation documentation (line 81 of installation.md), the version command outputs "scrut v0.X.Y" format, not "scrut 0.X.Y". The assertion should be changed to match "scrut v" followed by the version.

Suggested change
assert_match "scrut #{version}", shell_output("#{bin}/scrut --version")
assert_match "scrut v#{version}", shell_output("#{bin}/scrut --version")

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case the docs are wrong, not the test.

Copy link
Contributor

Choose a reason for hiding this comment

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

Your test is correct, the copilot is wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

$ cargo build --release
# ...

$ target/release/scrut --version
scrut 0.4.3

@ukautz
Copy link
Contributor

ukautz commented Jan 28, 2026

@cboone Thanks for this again! I really, really want Homebrew support as well, so more than happy you did that.

Two things:

  • I just upgraded the Scrut version to 0.4.3. This cannot be done via PR on GH only, it needs to come from our internal generation or I'll end up in sync conflicts. If you add / modify dependencies we will bump the version when merging the PR (or shortly after).
  • The hashes (sha256 "b05b..."): Right now they are hard coded. Ideally I want that file to be automatically created and committed, but afaik that would require a two-repository-setup (then using an action like this). For now: Can you add a script or extend the Makefile, to create the file?

@AndreasBackx
Copy link
Member

If only we had proper stacked diffs! Thank you for your changes!

@cboone
Copy link
Contributor Author

cboone commented Jan 29, 2026

  • I just upgraded the Scrut version to 0.4.3. This cannot be done via PR on GH only, it needs to come from our internal generation or I'll end up in sync conflicts. If you add / modify dependencies we will bump the version when merging the PR (or shortly after).
  • The hashes (sha256 "b05b..."): Right now they are hard coded. Ideally I want that file to be automatically created and committed, but afaik that would require a two-repository-setup (then using an action like this). For now: Can you add a script or extend the Makefile, to create the file?

Absolutely! Will do.

@cboone
Copy link
Contributor Author

cboone commented Feb 20, 2026

Sorry, totally dropped the ball here! I'll get it sorted today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants