homebrew-core
homebrew-core copied to clipboard
formulae: use `generate_completions`
- [x] Have you followed the guidelines for contributing?
- [x] Have you ensured that your commits follow the commit style guide?
- [x] Have you checked that there aren't other open pull requests for the same formula update/change?
- [ ] Have you built your formula locally with
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting? - [ ] Is your test running fine
brew test <formula>
, where<formula>
is the name of the formula you're submitting? - [ ] Does your build pass
brew audit --strict <formula>
(after doingbrew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?
needs https://github.com/Homebrew/brew/pull/13536
cc @MikeMcQuaid
As requested in https://github.com/Homebrew/brew/pull/13536, here is a sample PR to showcase the use of the new generate_completions
DSL.
This PR does not contain all formulae that would benefit from this, but only those that could be autocorrected by the RuboCop from https://github.com/Homebrew/brew/pull/13553 (with manual modifications to merge autodetected shells, since the Cop is not yet able to do that). This means that this PR only contains formulae previously using the following pattern
(bash_completion/"foo").write Utils.safe_popen_read(bin/"foo", "completions", "bash")
Once the RuboCop is finalized, I will update this PR to also include formulae using something along the lines of
output = Utils.safe_popen_read(bin/"foo", "completion", "bash")
(bash_completion/"foo").write output
But in the meantime, I think these selected formulae showcase the new DSL quite well 😄
I have updated the previously changed formulae with the updated DSL and RuboCop. As soon as both are finalized, I will work on also adding all non autocorrectable formulae to this PR too.
This branch now contains all formulae that can benefit from the new syntax 😄
The only exceptions I encountered were hatch
, awscli
and pipenv
, otherwise no formula needs to use the (bash_completion/"foo).write
syntax anymore 🎉
For this to pass CI, this will need either a long-timeout
or syntax-only
label 😄 (@Rylan12)
Cool, looks like this is good to go once https://github.com/Homebrew/brew/pull/13536 is in a tagged release!
This can be merged now that 3.5.10 is out, no? 😃 (@Rylan12)
This can be merged now that 3.5.10 is out, no? 😃 (@Rylan12)
Yep! Other maintainers can feel free to review and merge. I probably won't be able to take a look for a bit but will get to it in the next few days if no one else does first.
I went over all changed formulae again and, as suggested, changed custom shell_parameter_format
args to extended commands
, where applicable.
Here's my final set of comments. Everything else looks good 👍
Great! Thank you so much again for assisting in the whole process! 😄
:robot: A scheduled task has triggered a merge.