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

srgn 0.11.0 (new formula) #165653

Merged
merged 2 commits into from Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/autobump.txt
Expand Up @@ -1572,6 +1572,7 @@ squealer
squid
sratoolkit
src
srgn
Copy link
Member

Choose a reason for hiding this comment

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

@Homebrew/core do we want to automatically add all software to this list? Maybe we should make a blocklist instead then.

Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it be better to store this information in the formula itself?

Copy link
Member Author

Choose a reason for hiding this comment

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

you mean autobump info?

Copy link
Member Author

Choose a reason for hiding this comment

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

I dont think we have a way of doing it now atm

Copy link
Member

Choose a reason for hiding this comment

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

No we don't, but it would seem to be 1. a more relevant place to put it, 2. more scalable (no merge conflicts, no tedious long list of formulas). Should we propose it?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds like something we should consider.

Maybe also have an option to specify if bumped by upstream as we removed those formulae in #164770 but we don't have a way to keep track of them. This can lead to us accidentally re-adding them and potentially messing up the upstream release flow. Otherwise, we would probably need another list to record this info to avoid having maintainers manually keep track of it.

Copy link
Member

Choose a reason for hiding this comment

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

We should only really make this a formula DSL if we're going to make it possible for third-party taps to use autobump somehow too.

We shouldn't add software automatically here but it does seem reasonable to add it manually.

srt
srtp
sshs
Expand Down
23 changes: 23 additions & 0 deletions Formula/s/srgn.rb
@@ -0,0 +1,23 @@
class Srgn < Formula
desc "Code surgeon for precise text and code transplantation"
homepage "https://github.com/alexpovel/srgn"
url "https://github.com/alexpovel/srgn/archive/refs/tags/srgn-v0.11.0.tar.gz"
sha256 "82b0fe9282293ce2a132769e0ad4640d531c08d43b23798e2a51ec917a89853c"
license "MIT"
head "https://github.com/alexpovel/srgn.git", branch: "main"

depends_on "rust" => :build

def install
system "cargo", "install", *std_cargo_args
end

test do
assert_match "H____", pipe_output("#{bin}/srgn '[a-z]' '_'", "Hello")

test_string = "Hide ghp_th15 and ghp_th4t"
assert_match "Hide ******** and ********", pipe_output("#{bin}/srgn '(ghp_[[:alnum:]]+)' '*'", test_string)

assert_match version.to_s, shell_output("#{bin}/srgn --version")
end
end