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

formulae: use language-specific heredoc / squiggly heredoc #199789

Merged
merged 8 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions Formula/f/flagd.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Flagd < Formula

Check notice on line 1 in Formula/f/flagd.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

Bottle cache hit

Bottle for flagd built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/f/flagd.rb

View workflow job for this annotation

GitHub Actions / macOS 15-arm64

Bottle cache hit

Bottle for flagd built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/f/flagd.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

Bottle cache hit

Bottle for flagd built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/f/flagd.rb

View workflow job for this annotation

GitHub Actions / Linux

Bottle cache hit

Bottle for flagd built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/f/flagd.rb

View workflow job for this annotation

GitHub Actions / macOS 13-x86_64

Bottle cache hit

Bottle for flagd built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/f/flagd.rb

View workflow job for this annotation

GitHub Actions / macOS 14-x86_64

Bottle cache hit

Bottle for flagd built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)
desc "Feature flag daemon with a Unix philosophy"
homepage "https://github.com/open-feature/flagd"
url "https://github.com/open-feature/flagd.git",
Expand Down Expand Up @@ -34,22 +34,19 @@

test do
port = free_port

json_url = "https://raw.githubusercontent.com/open-feature/flagd/main/config/samples/example_flags.json"
resolve_boolean_command = <<~BASH
curl \
--request POST \
--data '{"flagKey":"myBoolFlag","context":{}}' \
--header "Content-Type: application/json" \
localhost:#{port}/schema.v1.Service/ResolveBoolean
BASH

pid = spawn bin/"flagd", "start", "-f", json_url, "-p", port.to_s
begin
pid = fork do
exec bin/"flagd", "start", "-f",
"https://raw.githubusercontent.com/open-feature/flagd/main/config/samples/example_flags.json",
"-p", port.to_s
end
sleep 3

resolve_boolean_command = <<-BASH
curl -X POST "localhost:#{port}/schema.v1.Service/ResolveBoolean" -d '{"flagKey":"myBoolFlag","context":{}}' -H "Content-Type: application/json"
BASH

expected_output = /true/

assert_match expected_output, shell_output(resolve_boolean_command)
assert_match(/true/, shell_output(resolve_boolean_command))
ensure
Process.kill("TERM", pid)
Process.wait(pid)
Expand Down
9 changes: 5 additions & 4 deletions Formula/f/foot.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Foot < Formula

Check notice on line 1 in Formula/f/foot.rb

View workflow job for this annotation

GitHub Actions / Linux

Bottle cache hit

Bottle for foot built at c3ba771578a (Merge 2bb18f1a9382921a6257fa53df7c476f1d329192 into a8275ffc6814b4e855f08859d357d6e5945bef7e, 2024-12-02)
desc "Fast, lightweight and minimalistic Wayland terminal emulator"
homepage "https://codeberg.org/dnkl/foot"
url "https://codeberg.org/dnkl/foot/archive/1.19.0.tar.gz"
Expand Down Expand Up @@ -37,20 +37,21 @@

mkdir_p config_dir

File.write config_file, <<-EOF
config_file.write <<~INI
[cursor]
style=blok
EOF
INI

assert_match(
/blok: not one of 'block', 'underline', 'beam'/,
shell_output("#{bin}/foot --check-config 2>&1", 230),
)

File.write config_file, <<-EOF
rm(config_file)
config_file.write <<~INI
[cursor]
style=block
EOF
INI

assert_empty shell_output("#{bin}/foot --check-config")
end
Expand Down
5 changes: 2 additions & 3 deletions Formula/k/kanata.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Kanata < Formula

Check notice on line 1 in Formula/k/kanata.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

Bottle cache hit

Bottle for kanata built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/k/kanata.rb

View workflow job for this annotation

GitHub Actions / macOS 15-arm64

Bottle cache hit

Bottle for kanata built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/k/kanata.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

Bottle cache hit

Bottle for kanata built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/k/kanata.rb

View workflow job for this annotation

GitHub Actions / Linux

Bottle cache hit

Bottle for kanata built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/k/kanata.rb

View workflow job for this annotation

GitHub Actions / macOS 13-x86_64

Bottle cache hit

Bottle for kanata built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/k/kanata.rb

View workflow job for this annotation

GitHub Actions / macOS 14-x86_64

Bottle cache hit

Bottle for kanata built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)
desc "Cross-platform software keyboard remapper for Linux, macOS and Windows"
homepage "https://github.com/jtroo/kanata"
url "https://github.com/jtroo/kanata/archive/refs/tags/v1.7.0.tar.gz"
Expand All @@ -22,7 +22,7 @@
end

test do
minimal_config = <<-CFG
(testpath/"kanata.kbd").write <<~LISP
(defsrc
caps grv i
j k l
Expand All @@ -45,9 +45,8 @@
cap (tap-hold-press 200 200 caps lctl)
grv (tap-hold-press 200 200 grv (layer-toggle arrows))
)
CFG
LISP

(testpath/"kanata.kbd").write(minimal_config)
system bin/"kanata", "--check"
end
end
2 changes: 1 addition & 1 deletion Formula/p/podman.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Podman < Formula

Check notice on line 1 in Formula/p/podman.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

Bottle cache hit

Bottle for podman built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/p/podman.rb

View workflow job for this annotation

GitHub Actions / macOS 15-arm64

Bottle cache hit

Bottle for podman built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/p/podman.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

Bottle cache hit

Bottle for podman built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/p/podman.rb

View workflow job for this annotation

GitHub Actions / Linux

Bottle cache hit

Bottle for podman built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/p/podman.rb

View workflow job for this annotation

GitHub Actions / macOS 13-x86_64

Bottle cache hit

Bottle for podman built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/p/podman.rb

View workflow job for this annotation

GitHub Actions / macOS 14-x86_64

Bottle cache hit

Bottle for podman built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)
desc "Tool for managing OCI containers and pods"
homepage "https://podman.io/"
url "https://github.com/containers/podman.git",
Expand Down Expand Up @@ -162,7 +162,7 @@
EOS
end
on_macos do
<<-EOS
<<~EOS
In order to run containers locally, podman depends on a Linux kernel.
One can be started manually using `podman machine` from this package.
To start a podman VM automatically at login, also install the cask
Expand Down
64 changes: 32 additions & 32 deletions Formula/r/rust-analyzer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class RustAnalyzer < Formula

Check notice on line 1 in Formula/r/rust-analyzer.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

Bottle cache hit

Bottle for rust-analyzer built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/r/rust-analyzer.rb

View workflow job for this annotation

GitHub Actions / macOS 15-arm64

Bottle cache hit

Bottle for rust-analyzer built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/r/rust-analyzer.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

Bottle cache hit

Bottle for rust-analyzer built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/r/rust-analyzer.rb

View workflow job for this annotation

GitHub Actions / Linux

Bottle cache hit

Bottle for rust-analyzer built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/r/rust-analyzer.rb

View workflow job for this annotation

GitHub Actions / macOS 13-x86_64

Bottle cache hit

Bottle for rust-analyzer built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/r/rust-analyzer.rb

View workflow job for this annotation

GitHub Actions / macOS 14-x86_64

Bottle cache hit

Bottle for rust-analyzer built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)
desc "Experimental Rust compiler front-end for IDEs"
homepage "https://rust-analyzer.github.io/"
url "https://github.com/rust-lang/rust-analyzer.git",
Expand Down Expand Up @@ -30,42 +30,42 @@
end

test do
input = rpc <<-EOF
{
"jsonrpc":"2.0",
"id":1,
"method":"initialize",
"params": {
"rootUri": "file:/dev/null",
"capabilities": {}
input = rpc <<~JSON
{
"jsonrpc":"2.0",
"id":1,
"method":"initialize",
"params": {
"rootUri": "file:/dev/null",
"capabilities": {}
}
}
}
EOF
JSON

input += rpc <<-EOF
{
"jsonrpc":"2.0",
"method":"initialized",
"params": {}
}
EOF
input += rpc <<~JSON
{
"jsonrpc":"2.0",
"method":"initialized",
"params": {}
}
JSON

input += rpc <<-EOF
{
"jsonrpc":"2.0",
"id": 1,
"method":"shutdown",
"params": null
}
EOF
input += rpc <<~JSON
{
"jsonrpc":"2.0",
"id": 1,
"method":"shutdown",
"params": null
}
JSON

input += rpc <<-EOF
{
"jsonrpc":"2.0",
"method":"exit",
"params": {}
}
EOF
input += rpc <<~JSON
{
"jsonrpc":"2.0",
"method":"exit",
"params": {}
}
JSON

output = /Content-Length: \d+\r\n\r\n/

Expand Down
23 changes: 10 additions & 13 deletions Formula/s/slides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,25 @@ def install
end

test do
(testpath/"test.md").write <<-MARKDOWN
# Slide 1
Content
(testpath/"test.md").write <<~MARKDOWN
# Slide 1
Content

---
---

# Slide 2
More Content
# Slide 2
More Content
MARKDOWN

# Bubbletea-based apps are hard to test even under PTY.spawn (or via
# expect) because they rely on vt100-like answerback support, such as
# "<ESC>[6n" to report the cursor position. For now we just run the command
# for a second and see that it tried to send some ANSI out of it.
require "pty"
r, _, pid = PTY.spawn "#{bin}/slides test.md"
sleep 1
Process.kill("TERM", pid)
begin
assert_match(/\e\[/, r.read)
rescue Errno::EIO
# GNU/Linux raises EIO when read is done on closed pty
PTY.spawn(bin/"slides", "test.md") do |r, _, pid|
sleep 1
Process.kill("TERM", pid)
assert_match(/\e\[/, r.read_nonblock(1024))
end
end
end
64 changes: 32 additions & 32 deletions Formula/t/texlab.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Texlab < Formula

Check notice on line 1 in Formula/t/texlab.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

Bottle cache hit

Bottle for texlab built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/t/texlab.rb

View workflow job for this annotation

GitHub Actions / macOS 15-arm64

Bottle cache hit

Bottle for texlab built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/t/texlab.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

Bottle cache hit

Bottle for texlab built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/t/texlab.rb

View workflow job for this annotation

GitHub Actions / Linux

Bottle cache hit

Bottle for texlab built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/t/texlab.rb

View workflow job for this annotation

GitHub Actions / macOS 13-x86_64

Bottle cache hit

Bottle for texlab built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)
desc "Implementation of the Language Server Protocol for LaTeX"
homepage "https://github.com/latex-lsp/texlab/"
url "https://github.com/latex-lsp/texlab/archive/refs/tags/v5.21.0.tar.gz"
Expand Down Expand Up @@ -26,42 +26,42 @@
end

test do
input = rpc <<-EOF
{
"jsonrpc":"2.0",
"id":1,
"method":"initialize",
"params": {
"rootUri": "file:/dev/null",
"capabilities": {}
input = rpc <<~JSON
{
"jsonrpc":"2.0",
"id":1,
"method":"initialize",
"params": {
"rootUri": "file:/dev/null",
"capabilities": {}
}
}
}
EOF
JSON

input += rpc <<-EOF
{
"jsonrpc":"2.0",
"method":"initialized",
"params": {}
}
EOF
input += rpc <<~JSON
{
"jsonrpc":"2.0",
"method":"initialized",
"params": {}
}
JSON

input += rpc <<-EOF
{
"jsonrpc":"2.0",
"id": 1,
"method":"shutdown",
"params": null
}
EOF
input += rpc <<~JSON
{
"jsonrpc":"2.0",
"id": 1,
"method":"shutdown",
"params": null
}
JSON

input += rpc <<-EOF
{
"jsonrpc":"2.0",
"method":"exit",
"params": {}
}
EOF
input += rpc <<~JSON
{
"jsonrpc":"2.0",
"method":"exit",
"params": {}
}
JSON

output = /Content-Length: \d+\r\n\r\n/

Expand Down
10 changes: 5 additions & 5 deletions Formula/v/vhs.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Vhs < Formula

Check notice on line 1 in Formula/v/vhs.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

Bottle cache hit

Bottle for vhs built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/v/vhs.rb

View workflow job for this annotation

GitHub Actions / macOS 15-arm64

Bottle cache hit

Bottle for vhs built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/v/vhs.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

Bottle cache hit

Bottle for vhs built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/v/vhs.rb

View workflow job for this annotation

GitHub Actions / Linux

Bottle cache hit

Bottle for vhs built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)

Check notice on line 1 in Formula/v/vhs.rb

View workflow job for this annotation

GitHub Actions / macOS 13-x86_64

Bottle cache hit

Bottle for vhs built at 6ae8e2ae0b4 (Merge 69032d9bad276eb2bfe4289326862ac007616d91 into 2f72c61fe00d3efdf3574974aa5b983757fdf1aa, 2024-12-02)
desc "Your CLI home video recorder"
homepage "https://github.com/charmbracelet/vhs"
url "https://github.com/charmbracelet/vhs/archive/refs/tags/v0.8.0.tar.gz"
Expand Down Expand Up @@ -30,11 +30,11 @@
end

test do
(testpath/"test.tape").write <<-TAPE
Output test.gif
Type "Foo Bar"
Enter
Sleep 1s
(testpath/"test.tape").write <<~TAPE
Output test.gif
Type "Foo Bar"
Enter
Sleep 1s
TAPE

system bin/"vhs", "validate", "test.tape"
Expand Down
Loading