Skip to content

Commit 31614ca

Browse files
committed
feat: add goimports linter, and format files with goimport -w
1 parent 0933a42 commit 31614ca

25 files changed

+62
-35
lines changed

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ linters:
300300
# Todo enable - too much for us
301301
#- godot # checks if comments end in a period
302302
# Todo enable - one small fix
303-
#- goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt
303+
- goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt
304304
- gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
305305
- goprintffuncname # checks that printf-like functions are named with f at the end
306306
# Todo enable - ignore for a few int overflow, and fix file permissions

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"embed"
5+
56
"github.com/yorukot/superfile/src/cmd"
67
)
78

src/cmd/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"embed"
55
"encoding/json"
66
"fmt"
7-
"github.com/yorukot/superfile/src/internal/common"
8-
"github.com/yorukot/superfile/src/internal/common/utils"
97
"io"
108
"log"
119
"log/slog"
@@ -14,6 +12,9 @@ import (
1412
"runtime"
1513
"time"
1614

15+
"github.com/yorukot/superfile/src/internal/common"
16+
"github.com/yorukot/superfile/src/internal/common/utils"
17+
1718
tea "github.com/charmbracelet/bubbletea"
1819
"github.com/charmbracelet/lipgloss"
1920
"github.com/urfave/cli/v2"

src/internal/common/predefined_variable.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package common
22

33
import (
4+
"time"
5+
46
"github.com/charmbracelet/lipgloss"
57
"github.com/charmbracelet/x/exp/term/ansi"
68
"github.com/yorukot/superfile/src/config/icon"
7-
"time"
89
)
910

1011
const WheelRunTime = 5

src/internal/common/utils/file_utils.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package utils
22

3-
import "os"
4-
import "fmt"
5-
import "github.com/pelletier/go-toml/v2"
6-
import "reflect"
3+
import (
4+
"fmt"
5+
"os"
6+
"reflect"
7+
8+
"github.com/pelletier/go-toml/v2"
9+
)
710

811
// Utility functions related to file operations
912

src/internal/common/utils/log_utils.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package utils
22

3-
import "log/slog"
4-
import "os"
3+
import (
4+
"log/slog"
5+
"os"
6+
)
57

68
// Todo : Eventually we want to remove all such usage that can result in app exiting abruptly
79
func LogAndExit(msg string, values ...any) {

src/internal/common/utils/shell_utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import (
44
"context"
55
"errors"
66
"fmt"
7-
variable "github.com/yorukot/superfile/src/config"
87
"log/slog"
98
"os/exec"
109
"runtime"
1110
"time"
11+
12+
variable "github.com/yorukot/superfile/src/config"
1213
)
1314

1415
// Choose correct shell as per OS

src/internal/config_function.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package internal
22

33
import (
4-
"github.com/yorukot/superfile/src/internal/common/utils"
54
"log/slog"
65
"os"
76
"path/filepath"
87
"runtime"
98
"strings"
109

10+
"github.com/yorukot/superfile/src/internal/common/utils"
11+
1112
"github.com/barasher/go-exiftool"
1213
variable "github.com/yorukot/superfile/src/config"
1314
"github.com/yorukot/superfile/src/config/icon"

src/internal/handle_panel_movement.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package internal
22

33
import (
4-
"github.com/yorukot/superfile/src/internal/common/utils"
54
"log/slog"
65
"os"
76
"os/exec"
87
"path/filepath"
98
"runtime"
109

10+
"github.com/yorukot/superfile/src/internal/common/utils"
11+
1112
variable "github.com/yorukot/superfile/src/config"
1213
)
1314

src/internal/handle_panel_navigation.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import (
44
"encoding/json"
55
"errors"
66
"fmt"
7-
"github.com/yorukot/superfile/src/internal/common"
87
"log/slog"
98
"os"
109
"path/filepath"
1110

11+
"github.com/yorukot/superfile/src/internal/common"
12+
1213
variable "github.com/yorukot/superfile/src/config"
1314
)
1415

0 commit comments

Comments
 (0)