Audit cask flight step conversions#22411
Draft
MikeMcQuaid wants to merge 1 commit into
Draft
Conversation
- Keep tap-wide conversion checks separate from the cask DSL change. - Encourage `*_steps` only when legacy `*flight` blocks are simple. - Match literal file-preparation calls that the step runner can model.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the RuboCop::Cop::Cask::InstallSteps cop to automatically convert “simple” legacy flight blocks (e.g., postflight do ... end) into the declarative *_steps DSL when the block consists solely of file-preparation operations that the steps runner can model.
Changes:
- Enable autocorrection for simple flight blocks by adding an
audit_flight_blockpath when a matching*_stepsstanza is not already present. - Implement an autocorrect that rewrites eligible flight blocks into the corresponding
*_stepsblock using the shared install-step conversion helper. - Update/add RuboCop spec coverage to assert both the offense and the expected corrected source, and ensure non-file-prep flight blocks are not autocorrected.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Library/Homebrew/rubocops/cask/install_steps.rb | Adds AutoCorrector support and converts simple pre/post/uninstall_*flight blocks into *_steps via shared conversion helpers. |
| Library/Homebrew/test/rubocops/cask/install_steps_spec.rb | Updates the spec to expect an offense + autocorrection for simple file-prep postflight blocks and keeps a negative case for non-file-prep blocks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blocked until next release.
*_stepsonly when legacy*flightblocks are simple.brew lgtm(style, typechecking and tests) with your changes locally?OpenAI Codex 5.5 xhigh with local review and testing.