Skip to content

Commit 890b9cd

Browse files
authored
Merge pull request #200080 from Homebrew/proto-scala-heredocs
formulae: use Protobuf/Scala specific heredoc delimiters
2 parents ad8560c + 5abbbfe commit 890b9cd

File tree

10 files changed

+22
-22
lines changed

10 files changed

+22
-22
lines changed

Formula/a/ammonite-repl.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ def install
3131
end
3232

3333
test do
34-
(testpath/"testscript.sc").write <<~EOS
34+
(testpath/"testscript.sc").write <<~SCALA
3535
#!/usr/bin/env amm
3636
@main
3737
def fn(): Unit = println("hello world!")
38-
EOS
38+
SCALA
3939
output = shell_output("#{bin}/amm #{testpath}/testscript.sc")
4040
assert_equal "hello world!", output.lines.last.chomp
4141
end

Formula/g/grpc-swift.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def install
3737
end
3838

3939
test do
40-
(testpath/"echo.proto").write <<~EOS
40+
(testpath/"echo.proto").write <<~PROTO
4141
syntax = "proto3";
4242
service Echo {
4343
rpc Get(EchoRequest) returns (EchoResponse) {}
@@ -51,7 +51,7 @@ def install
5151
message EchoResponse {
5252
string text = 1;
5353
}
54-
EOS
54+
PROTO
5555
system Formula["protobuf"].opt_bin/"protoc", "echo.proto", "--grpc-swift_out=."
5656
assert_predicate testpath/"echo.grpc.swift", :exist?
5757
end

Formula/g/grpcurl.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ def install
2121
end
2222

2323
test do
24-
(testpath/"test.proto").write <<~EOS
24+
(testpath/"test.proto").write <<~PROTO
2525
syntax = "proto3";
2626
package test;
2727
message HelloWorld {
2828
string hello_world = 1;
2929
}
30-
EOS
30+
PROTO
3131
system bin/"grpcurl", "-msg-template", "-proto", "test.proto", "describe", "test.HelloWorld"
3232
end
3333
end

Formula/m/mill.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ def install
2323
end
2424

2525
test do
26-
(testpath/"build.sc").write <<~EOS
26+
(testpath/"build.sc").write <<~SCALA
2727
import mill._
2828
import mill.scalalib._
2929
object foo extends ScalaModule {
3030
def scalaVersion = "2.13.11"
3131
}
32-
EOS
32+
SCALA
3333
output = shell_output("#{bin}/mill resolve __.compile")
3434
assert_equal "foo.compile", output.lines.last.chomp
3535
end

Formula/p/[email protected]

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def install
7474
end
7575

7676
test do
77-
testdata = <<~EOS
77+
testdata = <<~PROTO
7878
syntax = "proto3";
7979
package test;
8080
message TestCase {
@@ -83,7 +83,7 @@ def install
8383
message Test {
8484
repeated TestCase case = 1;
8585
}
86-
EOS
86+
PROTO
8787
(testpath/"test.proto").write testdata
8888
system bin/"protoc", "test.proto", "--cpp_out=."
8989

Formula/p/protoc-gen-go-grpc.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def install
3131
end
3232

3333
test do
34-
(testpath/"service.proto").write <<~EOS
34+
(testpath/"service.proto").write <<~PROTO
3535
syntax = "proto3";
3636
3737
option go_package = ".;proto";
@@ -42,7 +42,7 @@ def install
4242
4343
message HelloRequest {}
4444
message HelloResponse {}
45-
EOS
45+
PROTO
4646

4747
system "protoc", "--plugin=#{bin}/protoc-gen-go-grpc", "--go-grpc_out=.", "service.proto"
4848

Formula/p/protoc-gen-grpc-web.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def install
4444

4545
test do
4646
# First use the plugin to generate the files.
47-
testdata = <<~EOS
47+
testdata = <<~PROTO
4848
syntax = "proto3";
4949
package test;
5050
message TestCase {
@@ -59,7 +59,7 @@ def install
5959
service TestService {
6060
rpc RunTest(Test) returns (TestResult);
6161
}
62-
EOS
62+
PROTO
6363
(testpath/"test.proto").write testdata
6464
system "protoc", "test.proto", "--plugin=#{bin}/protoc-gen-grpc-web",
6565
"--js_out=import_style=commonjs:.",

Formula/p/protoc-gen-js.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ def install
3030
end
3131

3232
test do
33-
(testpath/"person.proto").write <<~EOS
33+
(testpath/"person.proto").write <<~PROTO
3434
syntax = "proto3";
3535
3636
message Person {
3737
int64 id = 1;
3838
string name = 2;
3939
}
40-
EOS
40+
PROTO
4141
system Formula["protobuf"].bin/"protoc", "--js_out=import_style=commonjs:.", "person.proto"
4242
assert_path_exists testpath/"person_pb.js"
4343
refute_predicate (testpath/"person_pb.js").size, :zero?

Formula/s/sbuild.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def install
3030
end
3131

3232
test do
33-
expected = <<~EOS
33+
expected = <<~SCALA
3434
import de.tototec.sbuild._
3535
3636
@version("#{version}")
@@ -45,7 +45,7 @@ class SBuild(implicit _project: Project) {
4545
}
4646
4747
}
48-
EOS
48+
SCALA
4949
system bin/"sbuild", "--create-stub"
5050
assert_equal expected, (testpath/"SBuild.scala").read
5151
end

Formula/s/scalariform.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ def install
3434
end
3535

3636
test do
37-
before_data = <<~EOS
37+
before_data = <<~SCALA
3838
def foo() {
3939
println("Hello World")
4040
}
41-
EOS
41+
SCALA
4242

43-
after_data = <<~EOS
43+
after_data = <<~SCALA
4444
def foo() {
4545
println("Hello World")
4646
}
47-
EOS
47+
SCALA
4848

4949
(testpath/"foo.scala").write before_data
5050
system bin/"scalariform", "-indentSpaces=3", testpath/"foo.scala"

0 commit comments

Comments
 (0)