From 84078dc21e632602861109a2834fa42cd05a63f9 Mon Sep 17 00:00:00 2001 From: Luke Kysow Date: Mon, 16 Jul 2018 17:29:28 +0200 Subject: [PATCH] Remove unused autoplan param. --- server/events/command_runner.go | 2 +- server/events/markdown_renderer.go | 2 +- server/events/markdown_renderer_test.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/events/command_runner.go b/server/events/command_runner.go index 330788201e..e1bbae1a2e 100644 --- a/server/events/command_runner.go +++ b/server/events/command_runner.go @@ -247,7 +247,7 @@ func (c *DefaultCommandRunner) updatePull(ctx *CommandContext, command CommandIn if err := c.CommitStatusUpdater.UpdateProjectResult(ctx, command.CommandName(), res); err != nil { ctx.Log.Warn("unable to update commit status: %s", err) } - comment := c.MarkdownRenderer.Render(res, command.CommandName(), ctx.Log.History.String(), command.IsVerbose(), command.IsAutoplan()) + comment := c.MarkdownRenderer.Render(res, command.CommandName(), ctx.Log.History.String(), command.IsVerbose()) c.VCSClient.CreateComment(ctx.BaseRepo, ctx.Pull.Num, comment) // nolint: errcheck } diff --git a/server/events/markdown_renderer.go b/server/events/markdown_renderer.go index 0d631a0a0f..27ecc20247 100644 --- a/server/events/markdown_renderer.go +++ b/server/events/markdown_renderer.go @@ -58,7 +58,7 @@ type ProjectResultTmplData struct { // Render formats the data into a markdown string. // nolint: interfacer -func (m *MarkdownRenderer) Render(res CommandResult, cmdName CommandName, log string, verbose bool, autoplan bool) string { +func (m *MarkdownRenderer) Render(res CommandResult, cmdName CommandName, log string, verbose bool) string { commandStr := strings.Title(cmdName.String()) common := CommonData{commandStr, verbose, log} if res.Error != nil { diff --git a/server/events/markdown_renderer_test.go b/server/events/markdown_renderer_test.go index 85a83414d6..950f152df3 100644 --- a/server/events/markdown_renderer_test.go +++ b/server/events/markdown_renderer_test.go @@ -51,7 +51,7 @@ func TestRenderErr(t *testing.T) { } for _, verbose := range []bool{true, false} { t.Log("testing " + c.Description) - s := r.Render(res, c.Command, "log", verbose, false) + s := r.Render(res, c.Command, "log", verbose) if !verbose { Equals(t, c.Expected, s) } else { @@ -91,7 +91,7 @@ func TestRenderFailure(t *testing.T) { } for _, verbose := range []bool{true, false} { t.Log("testing " + c.Description) - s := r.Render(res, c.Command, "log", verbose, false) + s := r.Render(res, c.Command, "log", verbose) if !verbose { Equals(t, c.Expected, s) } else { @@ -109,7 +109,7 @@ func TestRenderErrAndFailure(t *testing.T) { Error: errors.New("error"), Failure: "failure", } - s := r.Render(res, events.Plan, "", false, false) + s := r.Render(res, events.Plan, "", false) Equals(t, "**Plan Error**\n```\nerror\n```\n\n", s) } @@ -302,7 +302,7 @@ func TestRenderProjectResults(t *testing.T) { } for _, verbose := range []bool{true, false} { t.Run(c.Description, func(t *testing.T) { - s := r.Render(res, c.Command, "log", verbose, false) + s := r.Render(res, c.Command, "log", verbose) if !verbose { Equals(t, c.Expected, s) } else {