Skip to content

Commit

Permalink
Add backticks around stack IDs for markdown summary
Browse files Browse the repository at this point in the history
  • Loading branch information
menehune23 committed Nov 19, 2021
1 parent b773570 commit 76c0567
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion internal/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func printImplementation(writer io.Writer, config cargo.Config) {

fmt.Fprintf(writer, "#### Supported Stacks:\n")
for _, s := range config.Stacks {
fmt.Fprintf(writer, "- %s\n", s.ID)
fmt.Fprintf(writer, "- `%s`\n", s.ID)
}
fmt.Fprintln(writer)
}
Expand Down
24 changes: 9 additions & 15 deletions internal/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,11 @@ func testFormatter(t *testing.T, context spec.G, it spec.S) {

"\n\n**ID:** `some-buildpack`\n\n" +

"**Digest:** `sha256:some-buildpack-sha`" +

"**Digest:** `sha256:some-buildpack-sha`\n\n" +
"#### Supported Stacks:" +
"- `other-stack`\n" +
"- `some-stack`\n" +
`
#### Supported Stacks:
- other-stack
- some-stack
#### Default Dependency Versions:
| ID | Version |
|---|---|
Expand Down Expand Up @@ -126,15 +123,12 @@ func testFormatter(t *testing.T, context spec.G, it spec.S) {

"\n\n**ID:** `some-buildpack`\n\n" +

"**Digest:** `sha256:some-buildpack-sha`" +

`
#### Supported Stacks:
- other-stack
- some-stack
"**Digest:** `sha256:some-buildpack-sha`\n\n" +

`))
"#### Supported Stacks:\n" +
"- `other-stack`\n" +
"- `some-stack`\n\n",
))
})
})

Expand Down
17 changes: 8 additions & 9 deletions summarize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ version = "3.4.5"

"\n\n**ID:** `some-buildpack`\n\n" +

`#### Supported Stacks:
- other-stack
- some-stack
"#### Supported Stacks:\n" +
"- `other-stack`\n" +
"- `some-stack`\n" +
`
#### Default Dependency Versions:
| ID | Version |
|---|---|
Expand All @@ -298,11 +298,10 @@ version = "3.4.5"
<summary>Other Buildpack 2.3.4</summary>` +

"\n\n**ID:** `other-buildpack`\n\n" +

`#### Supported Stacks:
- first-stack
- second-stack
"#### Supported Stacks:\n" +
"- `first-stack`\n" +
"- `second-stack`\n" +
`
#### Default Dependency Versions:
| ID | Version |
|---|---|
Expand Down

0 comments on commit 76c0567

Please sign in to comment.