From eadc2ff45e34018a7fda7428a293da7a133d6b59 Mon Sep 17 00:00:00 2001 From: Grzegorz Dlugoszewski Date: Sun, 24 Aug 2025 17:18:03 +0200 Subject: [PATCH] Fix issues found by godot linter --- pkg/cfg/config.go | 2 +- pkg/dump.go | 2 +- pkg/git/repo.go | 2 +- pkg/git/status.go | 8 ++++---- pkg/git/test/helpers.go | 2 +- pkg/git/test/testrepos.go | 4 ++-- pkg/print/print.go | 2 +- pkg/print/tree.go | 2 +- pkg/url.go | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pkg/cfg/config.go b/pkg/cfg/config.go index 8e0670a..a690a64 100644 --- a/pkg/cfg/config.go +++ b/pkg/cfg/config.go @@ -65,7 +65,7 @@ func Version() string { return fmt.Sprintf("git-get %s", version) } -// Gitconfig represents gitconfig file +// Gitconfig represents gitconfig file. type Gitconfig interface { Get(key string) string } diff --git a/pkg/dump.go b/pkg/dump.go index decc2e0..64d8828 100644 --- a/pkg/dump.go +++ b/pkg/dump.go @@ -48,7 +48,7 @@ func parseDumpFile(path string) ([]parsedLine, error) { } // parseLine splits a dump file line into space-separated segments. -// First part is the URL to clone. Second, optional, is the branch (or tag) to checkout after cloning +// First part is the URL to clone. Second, optional, is the branch (or tag) to checkout after cloning. func parseLine(line string) (parsedLine, error) { var parsed parsedLine diff --git a/pkg/git/repo.go b/pkg/git/repo.go index 9a11861..ac599d2 100644 --- a/pkg/git/repo.go +++ b/pkg/git/repo.go @@ -65,7 +65,7 @@ func Clone(opts *CloneOpts) (*Repo, error) { return Repo, err } -// Fetch preforms a git fetch on all remotes +// Fetch preforms a git fetch on all remotes. func (r *Repo) Fetch() error { err := run.Git("fetch", "--all").OnRepo(r.path).AndShutUp() return err diff --git a/pkg/git/status.go b/pkg/git/status.go index 6f5607c..18b2ac3 100644 --- a/pkg/git/status.go +++ b/pkg/git/status.go @@ -160,22 +160,22 @@ func (s *Status) Branches() []string { return branches } -// BranchStatus returns status of a given branch +// BranchStatus returns status of a given branch. func (s *Status) BranchStatus(branch string) string { return s.branches[branch] } -// WorkTreeStatus returns status of a worktree +// WorkTreeStatus returns status of a worktree. func (s *Status) WorkTreeStatus() string { return s.worktree } -// Remote returns URL to remote repository +// Remote returns URL to remote repository. func (s *Status) Remote() string { return s.remote } -// Errors is a slice of errors that occurred when loading repo status +// Errors is a slice of errors that occurred when loading repo status. func (s *Status) Errors() []string { return s.errors } diff --git a/pkg/git/test/helpers.go b/pkg/git/test/helpers.go index b18f2be..12cd8b2 100644 --- a/pkg/git/test/helpers.go +++ b/pkg/git/test/helpers.go @@ -92,7 +92,7 @@ func checkFatal(t *testing.T, err error) { } } -// removeTestDir removes a test directory +// removeTestDir removes a test directory. func removeTestDir(t *testing.T, dir string) { // Skip cleanup on Windows to avoid file locking issues in CI // The CI runner environment is destroyed after tests anyway diff --git a/pkg/git/test/testrepos.go b/pkg/git/test/testrepos.go index 407af6f..f4aae50 100644 --- a/pkg/git/test/testrepos.go +++ b/pkg/git/test/testrepos.go @@ -172,7 +172,7 @@ func RepoWithBranchAheadAndBehind(t *testing.T) *Repo { return r } -// RepoWithEmptyConfig creates a git repo with empty .git/config file +// RepoWithEmptyConfig creates a git repo with empty .git/config file. func RepoWithEmptyConfig(t *testing.T) *Repo { r := RepoEmpty(t) r.writeFile(filepath.Join(".git", "config"), "") @@ -180,7 +180,7 @@ func RepoWithEmptyConfig(t *testing.T) *Repo { return r } -// RepoWithValidConfig creates a git repo with valid content in .git/config file +// RepoWithValidConfig creates a git repo with valid content in .git/config file. func RepoWithValidConfig(t *testing.T) *Repo { r := RepoEmpty(t) diff --git a/pkg/print/print.go b/pkg/print/print.go index c69e509..1a4d470 100644 --- a/pkg/print/print.go +++ b/pkg/print/print.go @@ -10,7 +10,7 @@ const ( head = "HEAD" ) -// Printable represents a repository which status can be printed +// Printable represents a repository which status can be printed. type Printable interface { Path() string Current() string diff --git a/pkg/print/tree.go b/pkg/print/tree.go index 7021673..06fcb0e 100644 --- a/pkg/print/tree.go +++ b/pkg/print/tree.go @@ -203,7 +203,7 @@ func indentation(node *Node) string { return indent.String() } -// isYoungest checks if the node is the last one in the slice of children +// isYoungest checks if the node is the last one in the slice of children. func (n *Node) isYoungest() bool { if n.parent == nil { return true diff --git a/pkg/url.go b/pkg/url.go index 54f7913..92ef232 100644 --- a/pkg/url.go +++ b/pkg/url.go @@ -89,7 +89,7 @@ func normalizeURL(url *urlpkg.URL, defaultHost string, defaultScheme string) { // Eg, ssh://git@github.com:22/~user/repo.git => github.com/user/repo // // If skipHost is true, it removes the host part from the path. -// Eg, ssh://git@github.com:22/~user/repo.git => user/repo +// Eg, ssh://git@github.com:22/~user/repo.git => user/repo. func URLToPath(url urlpkg.URL, skipHost bool) string { // Remove port numbers from host. url.Host = strings.Split(url.Host, ":")[0]