mirror of
https://github.com/thegeeklab/git-sv.git
synced 2024-11-21 22:10:39 +00:00
refactor: remove unused variables
This commit is contained in:
parent
11580133b0
commit
7b3df4e245
@ -72,7 +72,7 @@ func nextVersionHandler(git sv.Git, semverProcessor sv.SemVerCommitsProcessor) f
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func commitLogHandler(git sv.Git, semverProcessor sv.SemVerCommitsProcessor) func(c *cli.Context) error {
|
func commitLogHandler(git sv.Git) func(c *cli.Context) error {
|
||||||
return func(c *cli.Context) error {
|
return func(c *cli.Context) error {
|
||||||
var commits []sv.GitCommitLog
|
var commits []sv.GitCommitLog
|
||||||
var err error
|
var err error
|
||||||
@ -162,7 +162,7 @@ func releaseNotesHandler(git sv.Git, semverProcessor sv.SemVerCommitsProcessor,
|
|||||||
var err error
|
var err error
|
||||||
|
|
||||||
if tag := c.String("t"); tag != "" {
|
if tag := c.String("t"); tag != "" {
|
||||||
rnVersion, date, commits, err = getTagVersionInfo(git, semverProcessor, tag)
|
rnVersion, date, commits, err = getTagVersionInfo(git, tag)
|
||||||
} else {
|
} else {
|
||||||
// TODO: should generate release notes if version was not updated?
|
// TODO: should generate release notes if version was not updated?
|
||||||
rnVersion, _, date, commits, err = getNextVersionInfo(git, semverProcessor)
|
rnVersion, _, date, commits, err = getNextVersionInfo(git, semverProcessor)
|
||||||
@ -178,7 +178,7 @@ func releaseNotesHandler(git sv.Git, semverProcessor sv.SemVerCommitsProcessor,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getTagVersionInfo(git sv.Git, semverProcessor sv.SemVerCommitsProcessor, tag string) (semver.Version, time.Time, []sv.GitCommitLog, error) {
|
func getTagVersionInfo(git sv.Git, tag string) (semver.Version, time.Time, []sv.GitCommitLog, error) {
|
||||||
tagVersion, err := sv.ToVersion(tag)
|
tagVersion, err := sv.ToVersion(tag)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return semver.Version{}, time.Time{}, nil, fmt.Errorf("error parsing version: %s from tag, message: %v", tag, err)
|
return semver.Version{}, time.Time{}, nil, fmt.Errorf("error parsing version: %s from tag, message: %v", tag, err)
|
||||||
@ -280,7 +280,7 @@ func getCommitScope(cfg Config, p sv.MessageProcessor, input string, noScope boo
|
|||||||
return input, p.ValidateScope(input)
|
return input, p.ValidateScope(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
func getCommitDescription(cfg Config, p sv.MessageProcessor, input string) (string, error) {
|
func getCommitDescription(p sv.MessageProcessor, input string) (string, error) {
|
||||||
if input == "" {
|
if input == "" {
|
||||||
return promptSubject()
|
return promptSubject()
|
||||||
}
|
}
|
||||||
@ -365,7 +365,7 @@ func commitHandler(cfg Config, git sv.Git, messageProcessor sv.MessageProcessor)
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
subject, err := getCommitDescription(cfg, messageProcessor, inputDescription)
|
subject, err := getCommitDescription(messageProcessor, inputDescription)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ func main() {
|
|||||||
Aliases: []string{"cl"},
|
Aliases: []string{"cl"},
|
||||||
Usage: "list all commit logs according to range as jsons",
|
Usage: "list all commit logs according to range as jsons",
|
||||||
Description: "The range filter is used based on git log filters, check https://git-scm.com/docs/git-log for more info. When flag range is \"tag\" and start is empty, last tag created will be used instead. When flag range is \"date\", if \"end\" is YYYY-MM-DD the range will be inclusive.",
|
Description: "The range filter is used based on git log filters, check https://git-scm.com/docs/git-log for more info. When flag range is \"tag\" and start is empty, last tag created will be used instead. When flag range is \"date\", if \"end\" is YYYY-MM-DD the range will be inclusive.",
|
||||||
Action: commitLogHandler(git, semverProcessor),
|
Action: commitLogHandler(git),
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{Name: "t", Aliases: []string{"tag"}, Usage: "get commit log from a specific tag"},
|
&cli.StringFlag{Name: "t", Aliases: []string{"tag"}, Usage: "get commit log from a specific tag"},
|
||||||
&cli.StringFlag{Name: "r", Aliases: []string{"range"}, Usage: "type of range of commits, use: tag, date or hash", Value: string(sv.TagRange)},
|
&cli.StringFlag{Name: "r", Aliases: []string{"range"}, Usage: "type of range of commits, use: tag, date or hash", Value: string(sv.TagRange)},
|
||||||
|
Loading…
Reference in New Issue
Block a user