Skip to content

Commit

Permalink
make, tui: Fix increment linter errors
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Jumarea <[email protected]>
  • Loading branch information
StefanJum committed Dec 6, 2022
1 parent 1a4e47a commit 8fe224f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions make/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (opw *onProgressWriter) Write(b []byte) (int, error) {
for _, line := range lines {
for _, ignore := range IgnoredMakePrefixes {
if !strings.HasPrefix(line, ignore) {
opw.current += 1
opw.current++
}
}
}
Expand All @@ -84,7 +84,7 @@ func (cpw *calculateProgressWriter) Write(b []byte) (int, error) {
for _, line := range lines {
for _, ignore := range IgnoredMakePrefixes {
if !strings.HasPrefix(line, ignore) {
cpw.totalLines += 1
cpw.totalLines++
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions tui/paraprogress/paraprogress.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (md *ParaProgress) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
md.quitting = true
cmds = append(cmds, tea.Quit)
} else if (!md.failFast || msg.status == StatusSuccess) && !md.parallel {
md.curr += 1
md.curr++
if len(md.processes) > md.curr {
cmds = append(cmds, md.processes[md.curr].Start())
}
Expand All @@ -157,7 +157,7 @@ func (md *ParaProgress) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
if md.processes[i].Status == StatusFailed ||
md.processes[i].Status == StatusSuccess ||
md.processes[i].percent == 1 {
complete += 1
complete++
}
}

Expand Down
6 changes: 3 additions & 3 deletions tui/processtree/processtree.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func NewProcessTree(ctx context.Context, opts []ProcessTreeOption, tree ...*Proc
total := 0

pt.traverseTreeAndCall(tree, func(item *ProcessTreeItem) error {
total += 1
total++
item.norender = pt.norender
return nil
})
Expand Down Expand Up @@ -214,9 +214,9 @@ func (pt ProcessTree) getNextReadyChildren(tree []*ProcessTreeItem) []*ProcessTr
for _, child := range item.children {
if child.status == StatusFailed ||
child.status == StatusFailedChild {
failed += 1
failed++
} else if child.status == StatusSuccess {
completed += 1
completed++
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tui/processtree/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (pt *ProcessTree) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
if msg.status == StatusSuccess ||
msg.status == StatusFailed ||
msg.status == StatusFailedChild {
pt.finished += 1
pt.finished++
}

// No more processes then exit
Expand Down
8 changes: 4 additions & 4 deletions tui/processtree/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (pt ProcessTree) View() string {
if pti.status == StatusSuccess ||
pti.status == StatusFailed ||
pti.status == StatusFailedChild {
finished += 1
finished++
}

return nil
Expand Down Expand Up @@ -73,13 +73,13 @@ func (stm ProcessTree) printItem(pti *ProcessTreeItem, offset uint) string {
for _, child := range pti.children {
if child.status == StatusFailed ||
child.status == StatusFailedChild {
failed += 1
failed++
} else if child.status == StatusSuccess {
completed += 1
completed++
} else if child.status == StatusRunningChild ||
child.status == StatusRunning ||
child.status == StatusRunningButAChildHasFailed {
running += 1
running++
}
}

Expand Down

0 comments on commit 8fe224f

Please sign in to comment.