Skip to content

Commit f8b6e58

Browse files
authored
Merge pull request #197245 from Homebrew/json-heredocs
Use JSON language-specific heredoc delimiters
2 parents 5775077 + f72989f commit f8b6e58

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+118
-118
lines changed

Formula/a/all-repos.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ def install
2929
end
3030

3131
test do
32-
(testpath/"all-repos.json").write <<~EOS
32+
(testpath/"all-repos.json").write <<~JSON
3333
{
3434
"output_dir": "out",
3535
"source": "all_repos.source.json_file",
3636
"source_settings": {"filename": "repos.json"},
3737
"push": "all_repos.push.readonly",
3838
"push_settings": {}
3939
}
40-
EOS
40+
JSON
4141
chmod 0600, "all-repos.json"
42-
(testpath/"repos.json").write <<~EOS
42+
(testpath/"repos.json").write <<~JSON
4343
{"discussions": "https://github.com/Homebrew/discussions"}
44-
EOS
44+
JSON
4545

4646
system bin/"all-repos-clone"
4747
assert_predicate testpath/"out/discussions", :exist?

Formula/a/allure.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def install
2626
end
2727

2828
test do
29-
(testpath/"allure-results/allure-result.json").write <<~EOS
29+
(testpath/"allure-results/allure-result.json").write <<~JSON
3030
{
3131
"uuid": "allure",
3232
"name": "testReportGeneration",
@@ -50,7 +50,7 @@ def install
5050
}
5151
]
5252
}
53-
EOS
53+
JSON
5454
system bin/"allure", "generate", "#{testpath}/allure-results", "-o", "#{testpath}/allure-report"
5555
end
5656
end

Formula/a/avro-cpp.rb

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

3636
test do
37-
(testpath/"cpx.json").write <<~EOS
37+
(testpath/"cpx.json").write <<~JSON
3838
{
3939
"type": "record",
4040
"name": "cpx",
@@ -43,7 +43,7 @@ def install
4343
{"name": "im", "type" : "double"}
4444
]
4545
}
46-
EOS
46+
JSON
4747

4848
(testpath/"test.cpp").write <<~CPP
4949
#include "cpx.hh"

Formula/b/bit.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ def install
5656
end
5757

5858
test do
59-
(testpath/"Library/Caches/Bit/config/config.json").write <<~EOS
59+
(testpath/"Library/Caches/Bit/config/config.json").write <<~JSON
6060
{ "analytics_reporting": false, "error_reporting": false }
61-
EOS
61+
JSON
6262
output = shell_output("#{bin}/bit init --skip-update")
6363
assert_match "successfully initialized", output
6464
end

Formula/c/cfn-flip.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def install
4141
end
4242

4343
test do
44-
(testpath/"test.json").write <<~EOS
44+
(testpath/"test.json").write <<~JSON
4545
{
4646
"Resources": {
4747
"Bucket": {
@@ -54,7 +54,7 @@ def install
5454
}
5555
}
5656
}
57-
EOS
57+
JSON
5858

5959
expected = <<~EOS
6060
Resources:

Formula/c/cfripper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def install
111111
end
112112

113113
test do
114-
(testpath/"test.json").write <<~EOS
114+
(testpath/"test.json").write <<~JSON
115115
{
116116
"AWSTemplateFormatVersion": "2010-09-09",
117117
"Resources": {
@@ -136,7 +136,7 @@ def install
136136
}
137137
}
138138
}
139-
EOS
139+
JSON
140140

141141
output = shell_output("#{bin}/cfripper #{testpath}/test.json --format txt 2>&1")
142142
assert_match "no AWS Account ID was found in the config.", output

Formula/c/cfssl.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def caveats
3636
end
3737

3838
test do
39-
(testpath/"request.json").write <<~EOS
39+
(testpath/"request.json").write <<~JSON
4040
{
4141
"CN" : "Your Certificate Authority",
4242
"hosts" : [],
@@ -54,7 +54,7 @@ def caveats
5454
}
5555
]
5656
}
57-
EOS
57+
JSON
5858
shell_output("#{bin}/cfssl genkey -initca request.json > response.json")
5959
response = JSON.parse(File.read(testpath/"response.json"))
6060
assert_match(/^-----BEGIN CERTIFICATE-----.*/, response["cert"])

Formula/c/check-jsonschema.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,22 +147,22 @@ def install
147147
end
148148

149149
test do
150-
(testpath/"test.json").write <<~EOS
150+
(testpath/"test.json").write <<~JSON
151151
{
152152
"name" : "Eggs",
153153
"price" : 34.99
154154
}
155-
EOS
155+
JSON
156156

157-
(testpath/"test.schema").write <<~EOS
157+
(testpath/"test.schema").write <<~JSON
158158
{
159159
"type": "object",
160160
"properties": {
161161
"price": {"type": "number"},
162162
"name": {"type": "string"}
163163
}
164164
}
165-
EOS
165+
JSON
166166

167167
out = shell_output("#{bin}/check-jsonschema --schemafile #{testpath}/test.schema #{testpath}/test.json")
168168
assert_match "ok -- validation done", out

Formula/c/codecov-cli.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def install
123123
test do
124124
assert_equal "codecovcli, version #{version}\n", shell_output("#{bin}/codecovcli --version")
125125

126-
(testpath/"coverage.json").write <<~EOS
126+
(testpath/"coverage.json").write <<~JSON
127127
{
128128
"meta": { "format": 2 },
129129
"files": {},
@@ -133,7 +133,7 @@ def install
133133
"percent_covered": 100,
134134
}
135135
}
136-
EOS
136+
JSON
137137

138138
output = shell_output("#{bin}/codecovcli do-upload --commit-sha=mocksha --dry-run 2>&1")
139139
assert_match "Found 1 coverage files to report", output

Formula/c/copa.rb

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

3131
test do
3232
assert_match "Project Copacetic: container patching tool", shell_output("#{bin}/copa help")
33-
(testpath/"report.json").write <<~EOS
33+
(testpath/"report.json").write <<~JSON
3434
{
3535
"SchemaVersion": 2,
3636
"ArtifactName": "nginx:1.21.6",
3737
"ArtifactType": "container_image"
3838
}
39-
EOS
39+
JSON
4040
output = shell_output("#{bin}/copa patch --image=mcr.microsoft.com/oss/nginx/nginx:1.21.6 \
4141
--report=report.json 2>&1", 1)
4242
assert_match "Error: no scanning results for os-pkgs found", output

0 commit comments

Comments
 (0)