Remove indent parameter from printStep

It was always set to zero, so we can remove it now.
This commit is contained in:
Matt Ellis 2018-02-03 23:33:03 -08:00
parent ae7008ff85
commit ebc8c794fc
3 changed files with 4 additions and 5 deletions

View file

@ -142,7 +142,7 @@ func (acts *deployActions) OnResourceStepPre(step deploy.Step) (interface{}, err
// Report the beginning of the step if appropriate.
if shouldShow(acts.Seen, step, acts.Opts) || isRootStack(step) {
var b bytes.Buffer
printStep(&b, step, acts.Seen, acts.Opts.Summary, false, 0 /*indent*/, acts.Opts.Debug)
printStep(&b, step, acts.Seen, acts.Opts.Summary, false, acts.Opts.Debug)
acts.Opts.Events <- stdOutEventWithColor(&b)
}

View file

@ -250,7 +250,7 @@ func stepParentIndent(b *bytes.Buffer, step deploy.Step,
}
func printStep(b *bytes.Buffer, step deploy.Step, seen map[resource.URN]deploy.Step,
summary bool, planning bool, indent int, debug bool) {
summary bool, planning bool, debug bool) {
op := step.Op()
// First, indent to the same level as this resource has parents, and toggle the level of detail accordingly.
@ -258,7 +258,7 @@ func printStep(b *bytes.Buffer, step deploy.Step, seen map[resource.URN]deploy.S
// their parents, so this often does the right thing, but not always. For instance, we can have interleaved
// infrastructure that gets emitted in the middle of the flow, making things look like they are parented
// incorrectly. The real solution here is to have a more first class way of structuring the output.
indent = stepParentIndent(b, step, seen, planning, indent, true, debug)
indent := stepParentIndent(b, step, seen, planning, 0, true, debug)
// Print the indentation.
b.WriteString(getIndentationString(indent, op, false))

View file

@ -84,8 +84,7 @@ func (acts *previewActions) OnResourceStepPre(step deploy.Step) (interface{}, er
// Print this step information (resource and all its properties).
if shouldShow(acts.Seen, step, acts.Opts) || isRootStack(step) {
var b bytes.Buffer
printStep(&b, step,
acts.Seen, acts.Opts.Summary, true, 0 /*indent*/, acts.Opts.Debug)
printStep(&b, step, acts.Seen, acts.Opts.Summary, true, acts.Opts.Debug)
acts.Opts.Events <- stdOutEventWithColor(&b)
}
return nil, nil