Skip to content

Commit 26dda01

Browse files
committed
Cleanup: remove unused interfaces for helpers
I can only guess here: maybe they were added to more clearly document the public interface of the classes? If so, I don't think that works. Developers who are not familiar with the convention will just add a new public method to the class without updating the interface.
1 parent da74dde commit 26dda01

File tree

9 files changed

+0
-64
lines changed

9 files changed

+0
-64
lines changed

pkg/gui/controllers/helpers/commits_helper.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ import (
1212
"github.com/samber/lo"
1313
)
1414

15-
type ICommitsHelper interface {
16-
UpdateCommitPanelView(message string)
17-
}
18-
1915
type CommitsHelper struct {
2016
c *HelperCommon
2117

@@ -26,8 +22,6 @@ type CommitsHelper struct {
2622
setCommitDescription func(string)
2723
}
2824

29-
var _ ICommitsHelper = &CommitsHelper{}
30-
3125
func NewCommitsHelper(
3226
c *HelperCommon,
3327
getCommitSummary func() string,

pkg/gui/controllers/helpers/files_helper.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ import (
66
"github.com/samber/lo"
77
)
88

9-
type IFilesHelper interface {
10-
EditFiles(filenames []string) error
11-
EditFileAtLine(filename string, lineNumber int) error
12-
OpenFile(filename string) error
13-
}
14-
159
type FilesHelper struct {
1610
c *HelperCommon
1711
}
@@ -22,8 +16,6 @@ func NewFilesHelper(c *HelperCommon) *FilesHelper {
2216
}
2317
}
2418

25-
var _ IFilesHelper = &FilesHelper{}
26-
2719
func (self *FilesHelper) EditFiles(filenames []string) error {
2820
absPaths := lo.Map(filenames, func(filename string, _ int) string {
2921
absPath, err := filepath.Abs(filename)

pkg/gui/controllers/helpers/host_helper.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ import (
66

77
// this helper just wraps our hosting_service package
88

9-
type IHostHelper interface {
10-
GetPullRequestURL(from string, to string) (string, error)
11-
GetCommitURL(commitHash string) (string, error)
12-
}
13-
149
type HostHelper struct {
1510
c *HelperCommon
1611
}

pkg/gui/controllers/helpers/patch_building_helper.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ import (
99
"github.com/jesseduffield/lazygit/pkg/gui/types"
1010
)
1111

12-
type IPatchBuildingHelper interface {
13-
ValidateNormalWorkingTreeState() (bool, error)
14-
}
15-
1612
type PatchBuildingHelper struct {
1713
c *HelperCommon
1814
}

pkg/gui/controllers/helpers/refs_helper.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ import (
1414
"github.com/samber/lo"
1515
)
1616

17-
type IRefsHelper interface {
18-
CheckoutRef(ref string, options types.CheckoutRefOptions) error
19-
GetCheckedOutRef() *models.Branch
20-
CreateGitResetMenu(ref string) error
21-
ResetToRef(ref string, strength string, envVars []string) error
22-
NewBranch(from string, fromDescription string, suggestedBranchname string) error
23-
}
24-
2517
type RefsHelper struct {
2618
c *HelperCommon
2719
}
@@ -34,8 +26,6 @@ func NewRefsHelper(
3426
}
3527
}
3628

37-
var _ IRefsHelper = &RefsHelper{}
38-
3929
func (self *RefsHelper) CheckoutRef(ref string, options types.CheckoutRefOptions) error {
4030
waitingStatus := options.WaitingStatus
4131
if waitingStatus == "" {

pkg/gui/controllers/helpers/suggestions_helper.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,10 @@ import (
2626
// finding suggestions in this file, so that it's easy to see if a function already
2727
// exists for fetching a particular model.
2828

29-
type ISuggestionsHelper interface {
30-
GetRemoteSuggestionsFunc() func(string) []*types.Suggestion
31-
GetBranchNameSuggestionsFunc() func(string) []*types.Suggestion
32-
GetFilePathSuggestionsFunc() func(string) []*types.Suggestion
33-
GetRemoteBranchesSuggestionsFunc(separator string) func(string) []*types.Suggestion
34-
GetRefsSuggestionsFunc() func(string) []*types.Suggestion
35-
}
36-
3729
type SuggestionsHelper struct {
3830
c *HelperCommon
3931
}
4032

41-
var _ ISuggestionsHelper = &SuggestionsHelper{}
42-
4333
func NewSuggestionsHelper(
4434
c *HelperCommon,
4535
) *SuggestionsHelper {

pkg/gui/controllers/helpers/upstream_helper.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ type UpstreamHelper struct {
1414
getRemoteBranchesSuggestionsFunc func(string) func(string) []*types.Suggestion
1515
}
1616

17-
type IUpstreamHelper interface {
18-
ParseUpstream(string) (string, string, error)
19-
PromptForUpstreamWithInitialContent(*models.Branch, func(string) error) error
20-
PromptForUpstreamWithoutInitialContent(*models.Branch, func(string) error) error
21-
GetSuggestedRemote() string
22-
}
23-
24-
var _ IUpstreamHelper = &UpstreamHelper{}
25-
2617
func NewUpstreamHelper(
2718
c *HelperCommon,
2819
getRemoteBranchesSuggestionsFunc func(string) func(string) []*types.Suggestion,

pkg/gui/controllers/helpers/working_tree_helper.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ import (
1111
"github.com/jesseduffield/lazygit/pkg/gui/types"
1212
)
1313

14-
type IWorkingTreeHelper interface {
15-
AnyStagedFiles() bool
16-
AnyTrackedFiles() bool
17-
IsWorkingTreeDirty() bool
18-
FileForSubmodule(submodule *models.SubmoduleConfig) *models.File
19-
}
20-
2114
type WorkingTreeHelper struct {
2215
c *HelperCommon
2316
refHelper *RefsHelper

pkg/gui/controllers/helpers/worktree_helper.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ import (
1212
"github.com/jesseduffield/lazygit/pkg/utils"
1313
)
1414

15-
type IWorktreeHelper interface {
16-
GetMainWorktreeName() string
17-
GetCurrentWorktreeName() string
18-
}
19-
2015
type WorktreeHelper struct {
2116
c *HelperCommon
2217
reposHelper *ReposHelper

0 commit comments

Comments
 (0)