Skip to content

Commit 9d1da0c

Browse files
authored
Merge pull request #197024 from Homebrew/md-heredocs
Use Markdown language-specific heredoc delimiters
2 parents 5ca0a5a + 0453956 commit 9d1da0c

File tree

17 files changed

+40
-40
lines changed

17 files changed

+40
-40
lines changed

Formula/a/adr-viewer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def install
6767
test do
6868
adr_dir = testpath/"doc"/"adr"
6969
mkdir_p adr_dir
70-
(adr_dir/"0001-record.md").write <<~EOS
70+
(adr_dir/"0001-record.md").write <<~MARKDOWN
7171
# 1. Record architecture decisions
7272
Date: 2018-09-02
7373
## Status
@@ -78,7 +78,7 @@ def install
7878
We will use Architecture Decision Records, as [described by Michael Nygard](https://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions).
7979
## Consequences
8080
See Michael Nygard's article, linked above. For a lightweight ADR toolset, see Nat Pryce's [adr-tools](https://github.com/npryce/adr-tools).
81-
EOS
81+
MARKDOWN
8282
system bin/"adr-viewer", "--adr-path", adr_dir, "--output", "index.html"
8383
assert_predicate testpath/"index.html", :exist?
8484
end

Formula/f/ford.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def install
103103
end
104104

105105
test do
106-
(testpath/"test-project.md").write <<~EOS
106+
(testpath/"test-project.md").write <<~MARKDOWN
107107
project: Example Project
108108
summary: This is a short example project
109109
that demonstrates many of Ford's features
@@ -157,7 +157,7 @@ def install
157157
\end{equation}
158158
So let your imagination run wild. As you can tell, I'm more or less just
159159
filling in space now. This will be the last sentence.
160-
EOS
160+
MARKDOWN
161161
mkdir testpath/"src" do
162162
(testpath/"src"/"ford_test_program.f90").write <<~FORTRAN
163163
program ford_test_program

Formula/m/mandown.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ def install
2828

2929
test do
3030
(testpath/".config/mdn").mkpath # `mdn` may misbehave when its config directory is missing.
31-
(testpath/"test.md").write <<~EOS
31+
(testpath/"test.md").write <<~MARKDOWN
3232
# Hi from readme file!
33-
EOS
33+
MARKDOWN
3434
expected_output = <<~EOS
3535
<html><head><title>test.md(7)</title></head><body><h1>Hi from readme file!</h1>
3636
</body></html>

Formula/m/markdownlint-cli.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ def install
2222
end
2323

2424
test do
25-
(testpath/"test-bad.md").write <<~EOS
25+
(testpath/"test-bad.md").write <<~MARKDOWN
2626
# Header 1
2727
body
28-
EOS
29-
(testpath/"test-good.md").write <<~EOS
28+
MARKDOWN
29+
(testpath/"test-good.md").write <<~MARKDOWN
3030
# Header 1
3131

3232
body
33-
EOS
33+
MARKDOWN
3434
assert_match "MD022/blanks-around-headings Headings should be surrounded by blank lines",
3535
shell_output("#{bin}/markdownlint #{testpath}/test-bad.md 2>&1", 1)
3636
assert_empty shell_output("#{bin}/markdownlint #{testpath}/test-good.md")

Formula/m/markdownlint-cli2.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ def install
1717
end
1818

1919
test do
20-
(testpath/"test-bad.md").write <<~EOS
20+
(testpath/"test-bad.md").write <<~MARKDOWN
2121
# Header 1
2222
body
23-
EOS
24-
(testpath/"test-good.md").write <<~EOS
23+
MARKDOWN
24+
(testpath/"test-good.md").write <<~MARKDOWN
2525
# Header 1
2626

2727
body
28-
EOS
28+
MARKDOWN
2929
assert_match "Summary: 1 error(s)",
3030
shell_output("#{bin}/markdownlint-cli2 :#{testpath}/test-bad.md 2>&1", 1)
3131
assert_match "Summary: 0 error(s)",

Formula/m/marp-cli.rb

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

3131
test do
32-
(testpath/"deck.md").write <<~EOS
32+
(testpath/"deck.md").write <<~MARKDOWN
3333
---
3434
theme: uncover
3535
---
@@ -41,7 +41,7 @@ def install
4141
<!-- backgroundColor: blue -->
4242

4343
# <!--fit--> :+1:
44-
EOS
44+
MARKDOWN
4545

4646
system bin/"marp", testpath/"deck.md", "-o", testpath/"deck.html"
4747
assert_predicate testpath/"deck.html", :exist?

Formula/m/mask.rb

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

2525
test do
26-
(testpath/"maskfile.md").write <<~EOS
26+
(testpath/"maskfile.md").write <<~MARKDOWN
2727
# Example maskfile
2828

2929
## hello (name)
3030

3131
```sh
3232
printf "Hello %s!" "$name"
3333
```
34-
EOS
34+
MARKDOWN
3535
assert_equal "Hello Homebrew!", shell_output("#{bin}/mask hello Homebrew")
3636
end
3737
end

Formula/m/md4c.rb

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

2727
test do
2828
# test md2html
29-
(testpath/"test_md.md").write <<~EOS
29+
(testpath/"test_md.md").write <<~MARKDOWN
3030
# Title
3131
some text
32-
EOS
32+
MARKDOWN
3333
system bin/"md2html", "./test_md.md"
3434

3535
# test libmd4c

Formula/m/mdcat.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def install
3333
end
3434

3535
test do
36-
(testpath/"test.md").write <<~EOS
36+
(testpath/"test.md").write <<~MARKDOWN
3737
_lorem_ **ipsum** dolor **sit** _amet_
38-
EOS
38+
MARKDOWN
3939
output = shell_output("#{bin}/mdcat --no-colour test.md")
4040
assert_match "lorem ipsum dolor sit amet", output
4141
end

Formula/m/mdless.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ def install
2727

2828
test do
2929
assert_match "mdless #{version}", shell_output("#{bin}/mdless --version")
30-
(testpath/"test.md").write <<~EOS
30+
(testpath/"test.md").write <<~MARKDOWN
3131
# title first level
3232
## title second level
33-
EOS
33+
MARKDOWN
3434
out = shell_output("#{bin}/mdless --no-color -P test.md")
3535
assert_match(/^title first level =+$/, out)
3636
assert_match(/^title second level -+$/, out)

0 commit comments

Comments
 (0)