Skip to content

utils: add AST helper functions for editing formulae#10064

Merged
SeekingMeaning merged 2 commits intoHomebrew:masterfrom
SeekingMeaning:ast
Dec 23, 2020
Merged

utils: add AST helper functions for editing formulae#10064
SeekingMeaning merged 2 commits intoHomebrew:masterfrom
SeekingMeaning:ast

Conversation

@SeekingMeaning
Copy link
Copy Markdown
Contributor

@SeekingMeaning SeekingMeaning commented Dec 19, 2020

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?
  • Have you successfully run brew man locally and committed any changes?

This PR adds two functions:

  • Utils::AST.replace_formula_stanza!
  • Utils::AST.add_formula_stanza!

These will be useful for gradually replacing regexes (which can sometimes be unreliable)

@BrewTestBot
Copy link
Copy Markdown
Contributor

Review period will end on 2020-12-22 at 00:00:00 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Dec 19, 2020
@SeekingMeaning SeekingMeaning force-pushed the ast branch 3 times, most recently from bab78f6 to 132778e Compare December 19, 2020 17:39
Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Very nice so far 👏🏻 . Some basic unit tests for these would be nice (when you've nailed down the functionality).

Comment thread Library/Homebrew/utils/ast.rb Outdated
@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Dec 22, 2020
@BrewTestBot
Copy link
Copy Markdown
Contributor

Review period ended.

@SeekingMeaning SeekingMeaning marked this pull request as ready for review December 23, 2020 06:14
@MikeMcQuaid
Copy link
Copy Markdown
Member

Great work here @SeekingMeaning!

@dawidd6
Copy link
Copy Markdown
Contributor

dawidd6 commented Dec 23, 2020

I agree, this is very cool. Nice job!

@SeekingMeaning SeekingMeaning merged commit 943ee39 into Homebrew:master Dec 23, 2020
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Feb 1, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Feb 1, 2021
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.

4 participants