-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
format formulas with brew style --fix #1340
format formulas with brew style --fix #1340
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This won't fix all issues, but it does seem likely to reduce the number of issues like this one going forward.
This PR looks good, but one suggestion.
does mean that users following cargo-dist's instructions exactly will run into workflow failures.
We actually don't recommend that users create a tap with brew tap-new
- it's explicitly not mentioned in our documentation! We recommend that users simply create an empty repository to publish packages to. There are some advantages to brew test-bot
, but fewer in the cargo-dist case: while one of brew-test-bot's strengths is its ability to produce binary bottle packages, cargo-dist is already distributing binaries without using that infrastructure.
Since brew style
iterates through styles very quickly, I do feel it's not always helpful for user taps to make use of it for generated formulae like this one - brew style --fix
will help keep us up to date, but we still may end up being somewhat behind Homebrew's style schedule.
cargo-dist/templates/ci/github/partials/publish_homebrew.yml.j2
Outdated
Show resolved
Hide resolved
Oh wow, I must have read somewhere how to set up a tap and then totally misremembered where I saw it, apologies! Added a correction in the description. |
All good! I thought it might be something like that - and was a helpful reminder to me to check our docs to make sure they're actually suggesting what I intended them to! I'll give this a test tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gave it a test, and the changes it made are looking good: mistydemeo/homebrew-cargodisttest@1c5e0ac
Just a couple more suggestions before this gets merged!
cargo-dist/templates/ci/github/partials/publish_homebrew.yml.j2
Outdated
Show resolved
Hide resolved
Co-authored-by: Misty De Méo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Really appreciate it.
Fixes #1331.
Problem
Creating a personal tap with
brew tap-new
creates a default Github Actions workflow that runs a homebrew-specific style check (brew style <TAPNAME>
) on the repo. Cargo-dist's generated homebrew formulas fail this style check. This does not block the core functionality of cargo-dist's homebrew publishing functionality (formula still functions),but does mean that users following cargo-dist's instructions exactly will run into workflow failures(EDIT: This was not true at all- docs mention a plain repo, not one created withbrew tap-new
).Previously
It looks like this has come up before (#810) and it was solved by individually fixing each formatting problem in the templates (PR 818).
Solution
Rather than separately chase formatting issues as they come up, the homebrew publish workflow could run
brew style --fix
on each formula before committing it.Pros
Cons
brew style --fix
(could break something without cargo-dist code changes if brew pushes a bad change).Testing
I've tested this by manually making these changes in the generated workflow itself and tagging a release. This means that the generation itself hasn't explicitly been tested.
Example run with new action steps: https://github.com/cxreiff/ttysvr/actions/runs/10436301681