Skip to content

Commit

Permalink
Style fixes vol 3
Browse files Browse the repository at this point in the history
  • Loading branch information
kilpkonn committed Oct 30, 2020
1 parent d9bf451 commit c8a4aab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ linters:
- gomnd
- goprintffuncname
- gosimple
- govet
- ineffassign
- interfacer
- lll
- misspell
Expand Down
12 changes: 6 additions & 6 deletions project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func Initialize(terminal bool, tags []string, clearTags bool, autoLog string, lo
return b.String(), nil
}

func SetupHooks(local bool, gitRepoPath string, autoLog string) error {
func SetupHooks(local bool, gitRepoPath, autoLog string) error {
if !local {
if err := scm.FetchRemotesAddRefSpecs(GitFetchRefs, gitRepoPath); err != nil {
return err
Expand Down Expand Up @@ -232,10 +232,10 @@ func SetupTags(err error, tags []string, gtmPath string) ([]string, error) {
if err != nil {
return nil, err
}
return tags, err
return tags, nil
}

func SetUpPaths(cwd, wd string, err error) (string, string, string, error) {
func SetUpPaths(cwd, wd string, err error) (gitRepoPath string, workDirRoot string, gtmPath string, error error) {
if cwd == "" {
wd, err = os.Getwd()
} else {
Expand All @@ -246,7 +246,7 @@ func SetUpPaths(cwd, wd string, err error) (string, string, string, error) {
return "", "", "", err
}

gitRepoPath, err := scm.GitRepoPath(wd)
gitRepoPath, err = scm.GitRepoPath(wd)
if err != nil {
return "", "", "", fmt.Errorf(
"Unable to initialize Git Time Metric, Git repository not found in '%s'", wd)
Expand All @@ -256,7 +256,7 @@ func SetUpPaths(cwd, wd string, err error) (string, string, string, error) {
"Unable to initialize Git Time Metric, Git repository not found in %s", gitRepoPath)
}

workDirRoot, err := scm.Workdir(gitRepoPath)
workDirRoot, err = scm.Workdir(gitRepoPath)
if err != nil {
return "", "", "", fmt.Errorf(
"Unable to initialize Git Time Metric, Git working tree root not found in %s", workDirRoot)
Expand All @@ -268,7 +268,7 @@ func SetUpPaths(cwd, wd string, err error) (string, string, string, error) {
"Unable to initialize Git Time Metric, Git working tree root not found in %s", workDirRoot)
}

gtmPath := filepath.Join(workDirRoot, GTMDir)
gtmPath = filepath.Join(workDirRoot, GTMDir)
if _, err := os.Stat(gtmPath); os.IsNotExist(err) {
if err := os.MkdirAll(gtmPath, 0700); err != nil {
return "", "", "", err
Expand Down

0 comments on commit c8a4aab

Please sign in to comment.