Skip to content

Commit

Permalink
Merge pull request #605 from runatlantis/bb-formatting
Browse files Browse the repository at this point in the history
Add newline so bitbucket formats markdown
  • Loading branch information
lkysow authored Apr 24, 2019
2 parents 48cc9df + 568c7f9 commit 993f8d8
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions server/events/markdown_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ var singleProjectPlanUnsuccessfulTmpl = template.Must(template.New("").Parse(
"{{$result := index .Results 0}}Ran {{.Command}} for dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n\n" +
"{{$result.Rendered}}\n" + logTmpl))
var multiProjectPlanTmpl = template.Must(template.New("").Funcs(sprig.TxtFuncMap()).Parse(
"Ran {{.Command}} for {{ len .Results }} projects:\n" +
"Ran {{.Command}} for {{ len .Results }} projects:\n\n" +
"{{ range $result := .Results }}" +
"1. {{ if $result.ProjectName }}project: `{{$result.ProjectName}}` {{ end }}dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n" +
"{{end}}\n" +
Expand All @@ -213,7 +213,7 @@ var multiProjectPlanTmpl = template.Must(template.New("").Funcs(sprig.TxtFuncMap
" * `atlantis apply`{{end}}" +
logTmpl))
var multiProjectApplyTmpl = template.Must(template.New("").Funcs(sprig.TxtFuncMap()).Parse(
"Ran {{.Command}} for {{ len .Results }} projects:\n" +
"Ran {{.Command}} for {{ len .Results }} projects:\n\n" +
"{{ range $result := .Results }}" +
"1. {{ if $result.ProjectName }}project: `{{$result.ProjectName}}` {{ end }}dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n" +
"{{end}}\n" +
Expand Down
11 changes: 10 additions & 1 deletion server/events/markdown_renderer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func TestRenderProjectResults(t *testing.T) {
models.PlanCommand,
[]models.ProjectResult{},
models.Github,
"Ran Plan for 0 projects:\n\n\n",
"Ran Plan for 0 projects:\n\n\n\n",
},
{
"single successful plan",
Expand Down Expand Up @@ -262,6 +262,7 @@ $$$
},
models.Github,
`Ran Plan for 2 projects:
1. dir: $path$ workspace: $workspace$
1. project: $projectname$ dir: $path2$ workspace: $workspace$
Expand Down Expand Up @@ -311,6 +312,7 @@ $$$
},
models.Github,
`Ran Apply for 2 projects:
1. project: $projectname$ dir: $path$ workspace: $workspace$
1. dir: $path2$ workspace: $workspace$
Expand Down Expand Up @@ -394,6 +396,7 @@ $$$
},
models.Github,
`Ran Plan for 3 projects:
1. dir: $path$ workspace: $workspace$
1. dir: $path2$ workspace: $workspace$
1. project: $projectname$ dir: $path3$ workspace: $workspace$
Expand Down Expand Up @@ -447,6 +450,7 @@ $$$
},
models.Github,
`Ran Apply for 3 projects:
1. dir: $path$ workspace: $workspace$
1. dir: $path2$ workspace: $workspace$
1. dir: $path3$ workspace: $workspace$
Expand Down Expand Up @@ -493,6 +497,7 @@ $$$
},
models.Github,
`Ran Apply for 3 projects:
1. dir: $path$ workspace: $workspace$
1. dir: $path2$ workspace: $workspace$
1. dir: $path3$ workspace: $workspace$
Expand Down Expand Up @@ -837,6 +842,7 @@ func TestRenderProjectResults_MultiProjectApplyWrapped(t *testing.T) {
},
}, models.ApplyCommand, "log", false, models.Github)
exp := `Ran Apply for 2 projects:
1. dir: $.$ workspace: $staging$
1. dir: $.$ workspace: $production$
Expand Down Expand Up @@ -892,6 +898,7 @@ func TestRenderProjectResults_MultiProjectPlanWrapped(t *testing.T) {
},
}, models.PlanCommand, "log", false, models.Github)
exp := `Ran Plan for 2 projects:
1. dir: $.$ workspace: $staging$
1. dir: $.$ workspace: $production$
Expand Down Expand Up @@ -973,6 +980,7 @@ func TestRenderProjectResults_PlansDeleted(t *testing.T) {
PlansDeleted: true,
},
exp: `Ran Plan for 2 projects:
1. dir: $.$ workspace: $staging$
1. dir: $.$ workspace: $production$
Expand Down Expand Up @@ -1009,6 +1017,7 @@ func TestRenderProjectResults_PlansDeleted(t *testing.T) {
PlansDeleted: true,
},
exp: `Ran Plan for 2 projects:
1. dir: $.$ workspace: $staging$
1. dir: $.$ workspace: $production$
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Ran Plan for 2 projects:

1. dir: `dir1` workspace: `default`
1. dir: `dir2` workspace: `default`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Ran Plan for 2 projects:

1. dir: `staging` workspace: `default`
1. dir: `production` workspace: `default`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Ran Plan for 2 projects:

1. dir: `.` workspace: `default`
1. dir: `.` workspace: `staging`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Ran Apply for 2 projects:

1. dir: `.` workspace: `default`
1. dir: `.` workspace: `staging`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Ran Plan for 2 projects:

1. dir: `.` workspace: `default`
1. dir: `.` workspace: `staging`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Ran Apply for 2 projects:

1. dir: `.` workspace: `default`
1. dir: `.` workspace: `new_workspace`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Ran Plan for 2 projects:

1. project: `default` dir: `.` workspace: `default`
1. project: `staging` dir: `.` workspace: `default`

Expand Down

0 comments on commit 993f8d8

Please sign in to comment.