Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mfridman committed May 6, 2024
1 parent 10e190b commit 7668f0c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@ tidy:

build:
go build -o $$GOBIN/tparse main.go

search-todo:
@echo "Searching for TODOs in Go files..."
@rg '// TODO\(mf\):' --glob '*.go' || echo "No TODOs found."
1 change: 1 addition & 0 deletions internal/app/table_failed.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"

"github.com/charmbracelet/lipgloss"

"github.com/mfridman/tparse/parse"
)

Expand Down
3 changes: 2 additions & 1 deletion internal/app/table_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import (
"strings"

"github.com/charmbracelet/lipgloss"
"github.com/mfridman/tparse/parse"
"github.com/olekukonko/tablewriter"

"github.com/mfridman/tparse/parse"
)

type SummaryTableOptions struct {
Expand Down
1 change: 1 addition & 0 deletions internal/app/table_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strings"

"github.com/charmbracelet/lipgloss"

"github.com/mfridman/tparse/parse"
)

Expand Down
8 changes: 4 additions & 4 deletions internal/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func IsError(t *testing.T, err, target error) {
}
}

func Number(t *testing.T, got, want interface{}) {
func Number(t *testing.T, got, want any) {
t.Helper()
gotNumber, err := reflectToInt64(got)
if err != nil {
Expand All @@ -45,7 +45,7 @@ func Number(t *testing.T, got, want interface{}) {
}
}

func NumberNotZero(t *testing.T, got interface{}) {
func NumberNotZero(t *testing.T, got any) {
t.Helper()
gotNumber, err := reflectToInt64(got)
if err != nil {
Expand All @@ -70,14 +70,14 @@ func Contains(t *testing.T, got, want string) {
}
}

func Equal(t *testing.T, got, want interface{}) {
func Equal(t *testing.T, got, want any) {
t.Helper()
if !reflect.DeepEqual(got, want) {
t.Fatalf("failed deep equal:\ngot: %v\nwant: %v\v", got, want)
}
}

func reflectToInt64(v interface{}) (int64, error) {
func reflectToInt64(v any) (int64, error) {
switch typ := v.(type) {
case int, int8, int16, int32, int64:
return reflect.ValueOf(typ).Int(), nil
Expand Down
3 changes: 0 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ var (
progressPtr = flag.Bool("progress", false, "")
comparePtr = flag.String("compare", "", "")

// TODO(mf): implement this
ciPtr = flag.String("ci", "", "")

// Legacy flags
noBordersPtr = flag.Bool("noborders", false, "")
)
Expand Down

0 comments on commit 7668f0c

Please sign in to comment.