Skip to content

Commit ebe782d

Browse files
Merge pull request #81 from DylanDevelops/ravel/lint-entire-project
chore: Linting project
2 parents e80491c + aed8e79 commit ebe782d

20 files changed

Lines changed: 50 additions & 52 deletions

File tree

cmd/config/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313

1414
func ConfigCmd() *cobra.Command {
1515
cmd := &cobra.Command{
16-
Use: "config",
16+
Use: "config",
1717
Aliases: []string{"settings", "preferences"},
18-
Short: "Configure global tmpo settings",
19-
Long: `Set up global configuration for tmpo including currency, date/time format, and timezone.`,
18+
Short: "Configure global tmpo settings",
19+
Long: `Set up global configuration for tmpo including currency, date/time format, and timezone.`,
2020
Run: func(cmd *cobra.Command, args []string) {
2121
ui.NewlineAbove()
2222

cmd/entries/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"os"
66

7-
"github.com/DylanDevelops/tmpo/internal/settings"
87
"github.com/DylanDevelops/tmpo/internal/project"
8+
"github.com/DylanDevelops/tmpo/internal/settings"
99
"github.com/DylanDevelops/tmpo/internal/storage"
1010
"github.com/DylanDevelops/tmpo/internal/ui"
1111
"github.com/manifoldco/promptui"

cmd/entries/manual.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func ManualCmd() *cobra.Command {
6262
}
6363

6464
projectPrompt := promptui.Prompt{
65-
Label: projectLabel,
65+
Label: projectLabel,
6666
AllowEdit: true,
6767
}
6868

@@ -290,7 +290,6 @@ func validateTime(input string) error {
290290
return fmt.Errorf("invalid time format, use 12-hour (e.g., 9:30 AM) or 24-hour (e.g., 14:30)")
291291
}
292292

293-
294293
func validateEndDateTime(startDate, startTime, endDate, endTime, dateLayout string) error {
295294
start, err := parseDateTime(startDate, startTime, dateLayout)
296295
if err != nil {
@@ -313,15 +312,15 @@ func parseDateTime(date, timeStr, dateLayout string) (time.Time, error) {
313312
normalizedTime := normalizeAMPM(timeStr)
314313
dateTime := fmt.Sprintf("%s %s", date, normalizedTime)
315314

316-
if dt, err := time.ParseInLocation(dateLayout + " 3:04 PM", dateTime, settings.GetDisplayTimezone()); err == nil {
315+
if dt, err := time.ParseInLocation(dateLayout+" 3:04 PM", dateTime, settings.GetDisplayTimezone()); err == nil {
317316
return dt, nil
318317
}
319318

320-
if dt, err := time.ParseInLocation(dateLayout + " 03:04 PM", dateTime, settings.GetDisplayTimezone()); err == nil {
319+
if dt, err := time.ParseInLocation(dateLayout+" 03:04 PM", dateTime, settings.GetDisplayTimezone()); err == nil {
321320
return dt, nil
322321
}
323322

324-
return time.ParseInLocation(dateLayout + " 15:04", dateTime, settings.GetDisplayTimezone())
323+
return time.ParseInLocation(dateLayout+" 15:04", dateTime, settings.GetDisplayTimezone())
325324
}
326325

327326
func normalizeAMPM(input string) string {

cmd/history/stats.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ import (
66
"sort"
77
"time"
88

9-
"github.com/DylanDevelops/tmpo/internal/settings"
109
"github.com/DylanDevelops/tmpo/internal/currency"
10+
"github.com/DylanDevelops/tmpo/internal/settings"
1111
"github.com/DylanDevelops/tmpo/internal/storage"
1212
"github.com/DylanDevelops/tmpo/internal/ui"
1313
"github.com/spf13/cobra"
1414
)
1515

1616
var (
1717
statsToday bool
18-
statsWeek bool
18+
statsWeek bool
1919
)
2020

2121
func StatsCmd() *cobra.Command {

cmd/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ Track time effortlessly with automatic project detection and simple commands.`,
4646
cmd.AddCommand(tracking.PauseCmd())
4747
cmd.AddCommand(tracking.ResumeCmd())
4848
cmd.AddCommand(tracking.StatusCmd())
49-
49+
5050
// History
5151
cmd.AddCommand(history.LogCmd())
5252
cmd.AddCommand(history.StatsCmd())
5353
cmd.AddCommand(history.ExportCmd())
54-
54+
5555
// Entries
5656
cmd.AddCommand(entries.EditCmd())
5757
cmd.AddCommand(entries.DeleteCmd())

cmd/tracking/pause.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func PauseCmd() *cobra.Command {
3939
}
4040

4141
err = db.StopEntry(running.ID)
42-
if(err != nil) {
42+
if err != nil {
4343
ui.PrintError(ui.EmojiError, fmt.Sprintf("%v", err))
4444
os.Exit(1)
4545
}

cmd/tracking/start_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"path/filepath"
66
"testing"
77

8-
"github.com/DylanDevelops/tmpo/internal/settings"
98
"github.com/DylanDevelops/tmpo/internal/project"
9+
"github.com/DylanDevelops/tmpo/internal/settings"
1010
"github.com/stretchr/testify/assert"
1111
"github.com/stretchr/testify/require"
1212
)

cmd/tracking/status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func StatusCmd() *cobra.Command {
5353
}
5454

5555
if running.MilestoneName != nil && *running.MilestoneName != "" {
56-
ui.PrintInfo(4, ui.Bold("Milestone"), *running.MilestoneName);
56+
ui.PrintInfo(4, ui.Bold("Milestone"), *running.MilestoneName)
5757
}
5858

5959
ui.NewlineBelow()

cmd/tracking/stop.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func StopCmd() *cobra.Command {
3838
}
3939

4040
err = db.StopEntry(running.ID)
41-
if(err != nil) {
41+
if err != nil {
4242
ui.PrintError(ui.EmojiError, fmt.Sprintf("%v", err))
4343
os.Exit(1)
4444
}

cmd/utilities/version.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ var releaseVersionRegex = regexp.MustCompile(`^v?\d+\.\d+\.\d+(-[\w.]+)?$`)
2121

2222
func VersionCmd() *cobra.Command {
2323
cmd := &cobra.Command{
24-
Use: "version",
25-
Short: "Show version information",
26-
Long: "Display the current version information including date and release URL.",
24+
Use: "version",
25+
Short: "Show version information",
26+
Long: "Display the current version information including date and release URL.",
2727
Hidden: true,
2828
Run: func(cmd *cobra.Command, args []string) {
2929
DisplayVersionWithUpdateCheck()

0 commit comments

Comments
 (0)