Skip to content

Commit

Permalink
golangci-lint update 1.56.2
Browse files Browse the repository at this point in the history
Signed-off-by: Navid Yaghoobi <[email protected]>
  • Loading branch information
navidys committed Mar 5, 2024
1 parent 89ca96e commit 36e3d86
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ linters:
disable:
- varnamelen
- exhaustruct
- depguard
# deprecated
- rowserrcheck
- wastedassign
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ install.tools: .install.pre-commit .install.codespell .install.golangci-lint .in

.PHONY: .install.golangci-lint
.install.golangci-lint:
VERSION=1.51.1 ./hack/install_golangci.sh
VERSION=1.56.2 ./hack/install_golangci.sh

#=================================================
# Testing (units, functionality, ...) targets
Expand Down
6 changes: 3 additions & 3 deletions barchart.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package tvxwidgets

import (
"fmt"
"strconv"

"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
Expand Down Expand Up @@ -76,7 +76,7 @@ func (c *BarChart) Draw(screen tcell.Screen) { //nolint:funlen,cyclop
}
// set max value if not set
c.initMaxValue()
maxValueSr := fmt.Sprintf("%d", c.maxVal)
maxValueSr := strconv.Itoa(c.maxVal)
maxValLenght := len(maxValueSr) + 1

if maxValLenght < barChartYAxisLabelWidth {
Expand Down Expand Up @@ -136,7 +136,7 @@ func (c *BarChart) Draw(screen tcell.Screen) { //nolint:funlen,cyclop
}
}
// bar value
vSt := fmt.Sprintf("%d", item.value)
vSt := strconv.Itoa(item.value)
vRune := []rune(vSt)

for i := 0; i < len(vRune); i++ {
Expand Down
2 changes: 2 additions & 0 deletions dialog.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func (d *MessageDialog) InputHandler() func(event *tcell.EventKey, setFocus func
return
}
}

if formHandler := d.form.InputHandler(); formHandler != nil {
formHandler(event, setFocus)

Expand All @@ -148,6 +149,7 @@ func (d *MessageDialog) MouseHandler() func(action tview.MouseAction, event *tce
consumed, capture = d.form.MouseHandler()(action, event, setFocus)
if !consumed && action == tview.MouseLeftClick && d.InRect(event.Position()) {
setFocus(d)

consumed = true
}

Expand Down
2 changes: 1 addition & 1 deletion gauge_am.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (g *ActivityModeGauge) Draw(screen tcell.Screen) {
}

// Focus is called when this primitive receives focus.
func (g *ActivityModeGauge) Focus(delegate func(p tview.Primitive)) {
func (g *ActivityModeGauge) Focus(delegate func(p tview.Primitive)) { //nolint:revive
}

// HasFocus returns whether or not this primitive has focus.
Expand Down
2 changes: 1 addition & 1 deletion gauge_pm.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (g *PercentageModeGauge) Draw(screen tcell.Screen) {
}

// Focus is called when this primitive receives focus.
func (g *PercentageModeGauge) Focus(delegate func(p tview.Primitive)) {
func (g *PercentageModeGauge) Focus(delegate func(p tview.Primitive)) { //nolint:revive
}

// HasFocus returns whether or not this primitive has focus.
Expand Down
2 changes: 1 addition & 1 deletion gauge_um.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (g *UtilModeGauge) SetLabelColor(color tcell.Color) {
}

// Focus is called when this primitive receives focus.
func (g *UtilModeGauge) Focus(delegate func(p tview.Primitive)) {
func (g *UtilModeGauge) Focus(delegate func(p tview.Primitive)) { //nolint:revive
}

// HasFocus returns whether or not this primitive has focus.
Expand Down
8 changes: 3 additions & 5 deletions plot.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tvxwidgets
import (
"fmt"
"image"
"strconv"
"sync"

"github.com/gdamore/tcell/v2"
Expand Down Expand Up @@ -226,10 +227,7 @@ func (plot *Plot) drawXAxisLabelToScreen(

for labelX := x + plotYAxisLabelsWidth +
(plotXAxisLabelsGap)*plotHorizontalScale + 1; labelX < x+width-1; {
label := fmt.Sprintf(
"%d",
(labelX-(x+plotYAxisLabelsWidth)-1)/(plotHorizontalScale)+1,
)
label := strconv.Itoa((labelX-(x+plotYAxisLabelsWidth)-1)/(plotHorizontalScale) + 1)

tview.Print(screen, label, labelX, y+height-plotXAxisLabelsHeight, width, tview.AlignLeft, plot.axesLabelColor)

Expand All @@ -251,7 +249,7 @@ func (plot *Plot) drawYAxisLabelToScreen(screen tcell.Screen, plotYAxisLabelsWid
}
}

//nolint:gocognit,cyclop
//nolint:cyclop
func (plot *Plot) drawDotMarkerToScreen(screen tcell.Screen) {
x, y, width, height := plot.getChartAreaRect()
chartData := plot.getData()
Expand Down
1 change: 1 addition & 0 deletions sparkline.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func (sl *Sparkline) Draw(screen tcell.Screen) {
// print label
if sl.dataTitle != "" {
tview.Print(screen, sl.dataTitle, x, y, width, tview.AlignLeft, sl.dataTitlecolor)

barHeight--
}

Expand Down

0 comments on commit 36e3d86

Please sign in to comment.