Skip to content
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

Optimise more command handling/speed #17188

Merged
merged 1 commit into from
Apr 30, 2024
Merged

Conversation

MikeMcQuaid
Copy link
Member

  • in brew.sh split the case into those cases that take a single or no arguments and those that take multiple arguments or handle multiple commands. This considerably speeds up the brew shellenv bash case that wasn't being handled here before.
  • add setup-ruby to the list of commands that can be called quickly by brew.sh without additional setup. This speeds up the brew setup-ruby no-op case by ~10x.
  • add a parameter to setup-ruby to avoid running Bundler if the command doesn't need it. This makes many more cases for brew setup-ruby to be no-op cases.
  • Remove the (now) unused HOMEBREW_RUBY3 check in setup-ruby.
  • Improve argument handling in command_path.sh to allow it to be used as a function in setup-ruby.sh.
  • Add a new RuboCop to check usage of install_bundler_gems! is only inside dev-cmd (or a few other acceptable places) (follow-up from Call Homebrew.install_bundler_gems! more consistently. #17185 (comment))
  • Use new processed_source.file_path API in formula_cop.rb

- in `brew.sh` split the `case` into those cases that take a single or
  no arguments and those that take multiple arguments or handle
  multiple commands. This considerably speeds up the
  `brew shellenv bash` case that wasn't being handled here before.
- add `setup-ruby` to the list of commands that can be called quickly
  by `brew.sh` without additional setup. This speeds up the
  `brew setup-ruby` no-op case by ~10x.
- add a parameter to `setup-ruby` to avoid running Bundler if the
  command doesn't need it. This makes many more cases for
  `brew setup-ruby` to be no-op cases.
- Remove the (now) unused `HOMEBREW_RUBY3` check in `setup-ruby`.
- Improve argument handling in `command_path.sh` to allow it to be
  used as a function in `setup-ruby.sh`.
- Add a new RuboCop to check usage of `install_bundler_gems!` is only
  inside `dev-cmd` (or a few other acceptable places).
- Use new `processed_source.file_path` API in `formula_cop.rb`
@MikeMcQuaid MikeMcQuaid merged commit bfb8bb7 into master Apr 30, 2024
25 checks passed
@MikeMcQuaid MikeMcQuaid deleted the more_command_optimisation branch April 30, 2024 14:32
@github-actions github-actions bot added the outdated PR was locked due to age label May 31, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants