diff --git a/.golangci.yml b/.golangci.yml index fffc973..05cdc87 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -26,6 +26,7 @@ linters: linters: - dupl # We don't mind duplicated code in tests. It helps with clarity - varnamelen # We don't mind short var names in tests. + - revive # Complains too much about unused-params, but they help with tests readibility - path: test/ linters: - dupl diff --git a/cmd/get.go b/cmd/get.go index 8fba2d5..c9d4796 100644 --- a/cmd/get.go +++ b/cmd/get.go @@ -45,7 +45,7 @@ func newGetCommand() *cobra.Command { return cmd } -func runGetCommand(cmd *cobra.Command, args []string) error { +func runGetCommand(_ *cobra.Command, args []string) error { var url string if len(args) > 0 { url = args[0] diff --git a/cmd/list.go b/cmd/list.go index cf3b244..8a57e84 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -35,7 +35,7 @@ func newListCommand() *cobra.Command { return cmd } -func runListCommand(cmd *cobra.Command, args []string) error { +func runListCommand(_ *cobra.Command, _ []string) error { cfg.Expand(cfg.KeyReposRoot) config := &pkg.ListCfg{ diff --git a/cmd/main.go b/cmd/main.go index 22b5bd6..0222711 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -1,3 +1,7 @@ +// This program behaves as a git subcommand (see https://git.github.io/htmldocs/howto/new-command.html) +// When added to PATH, git recognizes it as its subcommand and it can be invoked as "git get..." or "git list..." +// It can also be invoked as a regular binary with subcommands: "git-get get..." or "git-get list" +// The following flow detects the invokation method and runs the appropriate command. package main import ( @@ -6,11 +10,6 @@ import ( "strings" ) -// This program behaves as a git subcommand (see https://git.github.io/htmldocs/howto/new-command.html) -// When added to PATH, git recognizes it as its subcommand and it can be invoked as "git get..." or "git list..." -// It can also be invoked as a regular binary with subcommands: "git-get get..." or "git-get list" -// The following flow detects the invokation method and runs the appropriate command. - func main() { command, args := determineCommand() executeCommand(command, args) diff --git a/pkg/git/config.go b/pkg/git/config.go index 113e1f2..7d29556 100644 --- a/pkg/git/config.go +++ b/pkg/git/config.go @@ -1,3 +1,4 @@ +// Package git implements functionalities to read and manipulate git repositories package git import ( diff --git a/pkg/git/test/helpers.go b/pkg/git/test/helpers.go index 20fffdd..b18f2be 100644 --- a/pkg/git/test/helpers.go +++ b/pkg/git/test/helpers.go @@ -1,3 +1,4 @@ +// Package test contains helper utilities and functions creating pre-configured test repositories for testing purposes package test import ( diff --git a/pkg/print/print.go b/pkg/print/print.go index 58d673a..c69e509 100644 --- a/pkg/print/print.go +++ b/pkg/print/print.go @@ -1,3 +1,4 @@ +// Package print implements different outputs for git-list command package print import ( diff --git a/pkg/url.go b/pkg/url.go index d383bed..54f7913 100644 --- a/pkg/url.go +++ b/pkg/url.go @@ -1,3 +1,4 @@ +// Package pkg implements the primary funcionality of the commands: list and get package pkg import (