Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
refactor: format with gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
profclems committed Aug 15, 2020
2 parents edad208 + 37da156 commit a916922
Show file tree
Hide file tree
Showing 51 changed files with 202 additions and 75 deletions.
12 changes: 6 additions & 6 deletions commands/issue_create.go
Expand Up @@ -33,13 +33,13 @@ var issueCreateCmd = &cobra.Command{
if description, _ := cmd.Flags().GetString("description"); description != "" {
issueDescription = strings.Trim(description, " ")
} else {
if editor, _ := cmd.Flags().GetBool("no-editor"); editor {
if editor, _ := cmd.Flags().GetBool("no-editor"); editor {
issueDescription = manip.AskQuestionMultiline("Description:", "")
} else {
issueDescription = manip.Editor(manip.EditorOptions{
Label: "Description:",
Help : "Enter the issue description. ",
FileName : "*_ISSUE_EDITMSG.md",
Label: "Description:",
Help: "Enter the issue description. ",
FileName: "*_ISSUE_EDITMSG.md",
})
}
}
Expand Down Expand Up @@ -94,8 +94,8 @@ func init() {
issueCreateCmd.Flags().StringP("assignee", "a", "", "Assign issue to people by their ID. Multiple values should be comma separated ")
issueCreateCmd.Flags().IntP("milestone", "m", -1, "The global ID of a milestone to assign issue")
issueCreateCmd.Flags().BoolP("confidential", "c", false, "Set an issue to be confidential. Default is false")
issueCreateCmd.Flags().IntP("linked-mr", "",-1, "The IID of a merge request in which to resolve all issues")
issueCreateCmd.Flags().IntP("weight", "w",-1, "The weight of the issue. Valid values are greater than or equal to 0.")
issueCreateCmd.Flags().IntP("linked-mr", "", -1, "The IID of a merge request in which to resolve all issues")
issueCreateCmd.Flags().IntP("weight", "w", -1, "The weight of the issue. Valid values are greater than or equal to 0.")
issueCreateCmd.Flags().BoolP("no-editor", "", false, "Don't open editor to enter description. If set to true, uses prompt. Default is false")
issueCmd.AddCommand(issueCreateCmd)
}
12 changes: 6 additions & 6 deletions commands/issue_note_create.go
Expand Up @@ -32,27 +32,27 @@ var issueNoteCreateCmd = &cobra.Command{
}
if body == "" {
body = manip.Editor(manip.EditorOptions{
Label: "Note Message:",
Help : "Enter the note message. ",
FileName : "ISSUE_NOTE_EDITMSG",
Label: "Note Message:",
Help: "Enter the note message. ",
FileName: "ISSUE_NOTE_EDITMSG",
})
}
if body == "" {
return errors.New("aborted... Note is empty")
}

noteInfo,_, err := gitlabClient.Notes.CreateIssueNote(repo, manip.StringToInt(mID), &gitlab.CreateIssueNoteOptions{
noteInfo, _, err := gitlabClient.Notes.CreateIssueNote(repo, manip.StringToInt(mID), &gitlab.CreateIssueNoteOptions{
Body: &body,
})
if err != nil {
return err
}
fmt.Printf("%s#note_%d\n",mr.WebURL, noteInfo.ID)
fmt.Printf("%s#note_%d\n", mr.WebURL, noteInfo.ID)
return nil
},
}

func init() {
issueNoteCreateCmd.Flags().StringP("message", "m", "", "Comment/Note message")
issueCmd.AddCommand(issueNoteCreateCmd)
}
}
12 changes: 6 additions & 6 deletions commands/mr_note_create.go
Expand Up @@ -33,27 +33,27 @@ var mrCreateNoteCmd = &cobra.Command{
}
if body == "" {
body = manip.Editor(manip.EditorOptions{
Label: "Note Message:",
Help : "Enter the note message for the merge request. ",
FileName : "*_MR_NOTE_EDITMSG.md",
Label: "Note Message:",
Help: "Enter the note message for the merge request. ",
FileName: "*_MR_NOTE_EDITMSG.md",
})
}
if body == "" {
log.Fatal("Aborted... Note has an empty message")
}

noteInfo,_, err := gitlabClient.Notes.CreateMergeRequestNote(repo, manip.StringToInt(mID), &gitlab.CreateMergeRequestNoteOptions{
noteInfo, _, err := gitlabClient.Notes.CreateMergeRequestNote(repo, manip.StringToInt(mID), &gitlab.CreateMergeRequestNoteOptions{
Body: &body,
})
if err != nil {
return err
}
fmt.Printf("%s#note_%d\n",mr.WebURL, noteInfo.ID)
fmt.Printf("%s#note_%d\n", mr.WebURL, noteInfo.ID)
return nil
},
}

func init() {
mrCreateNoteCmd.Flags().StringP("message", "m", "", "Comment/Note message")
mrCmd.AddCommand(mrCreateNoteCmd)
}
}
2 changes: 1 addition & 1 deletion commands/mr_rebase.go
Expand Up @@ -37,7 +37,7 @@ func acceptRebaseRequest(cmd *cobra.Command, args []string) {
opts.IncludeRebaseInProgress = gitlab.Bool(true)
fmt.Println("Checking rebase status...")
i := 0
for {
for {
mr, _, err := gitlabClient.MergeRequests.GetMergeRequest(repo, manip.StringToInt(mergeID), opts)
if err != nil {
log.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion docs/glab.md
Expand Up @@ -36,4 +36,4 @@ $ glab pipeline list
* [glab repo](glab_repo.md) - Work with GitLab repositories
* [glab version](glab_version.md) - show glab version information

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_check-update.md
Expand Up @@ -20,4 +20,4 @@ glab check-update [flags]

* [glab](glab.md) - A GitLab CLI Tool

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_config.md
Expand Up @@ -24,4 +24,4 @@ glab config [flags]

* [glab](glab.md) - A GitLab CLI Tool

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
3 changes: 2 additions & 1 deletion docs/glab_issue.md
Expand Up @@ -24,9 +24,10 @@ glab issue [command] [flags]
* [glab issue create](glab_issue_create.md) - Create an issue
* [glab issue delete](glab_issue_delete.md) - Delete an issue
* [glab issue list](glab_issue_list.md) - List project issues
* [glab issue note](glab_issue_note.md) - Add a comment or note to an issue on Gitlab
* [glab issue reopen](glab_issue_reopen.md) - Reopen a closed issue
* [glab issue subscribe](glab_issue_subscribe.md) - Subscribe to an issue
* [glab issue unsubscribe](glab_issue_unsubscribe.md) - Unsubscribe to an issue
* [glab issue view](glab_issue_view.md) - Display the title, body, and other information about an issue.

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_issue_close.md
Expand Up @@ -26,4 +26,4 @@ glab issue close <id> [flags]

* [glab issue](glab_issue.md) - Create, view and manage remote issues

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
20 changes: 11 additions & 9 deletions docs/glab_issue_create.md
Expand Up @@ -13,14 +13,16 @@ glab issue create [flags]
### Options

```
--allow-collaboration Allow collaboration
-a, --assignee string Assign issue to people by their ID. Multiple values should be comma separated
-d, --description string Supply a description for issue
-h, --help help for create
-l, --label string Add label by name. Multiple labels should be comma separated
-m, --milestone string add milestone by <id> for issue
--remove-source-branch Remove Source Branch after merge
-t, --title string Supply a title for issue
-a, --assignee string Assign issue to people by their ID. Multiple values should be comma separated
-c, --confidential Set an issue to be confidential. Default is false
-d, --description string Supply a description for issue
-h, --help help for create
-l, --label string Add label by name. Multiple labels should be comma separated
--linked-mr int The IID of a merge request in which to resolve all issues (default -1)
-m, --milestone int The global ID of a milestone to assign issue (default -1)
--no-editor Don't open editor to enter description. If set to true, uses prompt. Default is false
-t, --title string Supply a title for issue
-w, --weight int The weight of the issue. Valid values are greater than or equal to 0. (default -1)
```

### Options inherited from parent commands
Expand All @@ -33,4 +35,4 @@ glab issue create [flags]

* [glab issue](glab_issue.md) - Create, view and manage remote issues

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_issue_delete.md
Expand Up @@ -26,4 +26,4 @@ glab issue delete <id> [flags]

* [glab issue](glab_issue.md) - Create, view and manage remote issues

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_issue_list.md
Expand Up @@ -32,4 +32,4 @@ glab issue list [flags]

* [glab issue](glab_issue.md) - Create, view and manage remote issues

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
30 changes: 30 additions & 0 deletions docs/glab_issue_note.md
@@ -0,0 +1,30 @@
## glab issue note

Add a comment or note to an issue on Gitlab

### Synopsis

Add a comment or note to an issue on Gitlab

```
glab issue note <issue-id> [flags]
```

### Options

```
-h, --help help for note
-m, --message string Comment/Note message
```

### Options inherited from parent commands

```
-R, --repo string Select another repository using the OWNER/REPO format or the project ID. Supports group namespaces
```

### SEE ALSO

* [glab issue](glab_issue.md) - Create, view and manage remote issues

###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_issue_reopen.md
Expand Up @@ -26,4 +26,4 @@ glab issue reopen <id> [flags]

* [glab issue](glab_issue.md) - Create, view and manage remote issues

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_issue_subscribe.md
Expand Up @@ -26,4 +26,4 @@ glab issue subscribe <id> [flags]

* [glab issue](glab_issue.md) - Create, view and manage remote issues

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_issue_unsubscribe.md
Expand Up @@ -26,4 +26,4 @@ glab issue unsubscribe <id> [flags]

* [glab issue](glab_issue.md) - Create, view and manage remote issues

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_issue_view.md
Expand Up @@ -28,4 +28,4 @@ glab issue view <id> [flags]

* [glab issue](glab_issue.md) - Create, view and manage remote issues

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_label.md
Expand Up @@ -23,4 +23,4 @@ glab label <command> [flags]
* [glab label create](glab_label_create.md) - Create labels for repository/project
* [glab label list](glab_label_list.md) - List labels in repository

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_label_create.md
Expand Up @@ -29,4 +29,4 @@ glab label create [flags]

* [glab label](glab_label.md) - Manage labels on remote

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_label_list.md
Expand Up @@ -26,4 +26,4 @@ glab label list [flags]

* [glab label](glab_label.md) - Manage labels on remote

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
6 changes: 4 additions & 2 deletions docs/glab_mr.md
Expand Up @@ -21,17 +21,19 @@ glab mr <command> [flags]

* [glab](glab.md) - A GitLab CLI Tool
* [glab mr approve](glab_mr_approve.md) - Approve merge requests
* [glab mr browse](glab_mr_browse.md) - View merge request in a browser
* [glab mr close](glab_mr_close.md) - Close merge requests
* [glab mr create](glab_mr_create.md) - Create new merge request
* [glab mr delete](glab_mr_delete.md) - Delete merge requests
* [glab mr issues](glab_mr_issues.md) - Get issues related to a particular merge request.
* [glab mr list](glab_mr_list.md) - List merge requests
* [glab mr merge](glab_mr_merge.md) - Merge/Accept merge requests
* [glab mr note](glab_mr_note.md) - Add a comment or note to merge request
* [glab mr rebase](glab_mr_rebase.md) - Automatically rebase the source_branch of the merge request against its target_branch.
* [glab mr reopen](glab_mr_reopen.md) - Reopen merge requests
* [glab mr revoke](glab_mr_revoke.md) - Revoke approval on a merge request <id>
* [glab mr subscribe](glab_mr_subscribe.md) - Subscribe to merge requests
* [glab mr unsubscribe](glab_mr_unsubscribe.md) - Unsubscribe to merge requests
* [glab mr update](glab_mr_update.md) - Update merge requests
* [glab mr view](glab_mr_view.md) - Display the title, body, and other information about a merge request.

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_mr_approve.md
Expand Up @@ -27,4 +27,4 @@ glab mr approve <id> [flags]

* [glab mr](glab_mr.md) - Create, view and manage merge requests

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_mr_close.md
Expand Up @@ -26,4 +26,4 @@ glab mr close <id> [flags]

* [glab mr](glab_mr.md) - Create, view and manage merge requests

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
3 changes: 2 additions & 1 deletion docs/glab_mr_create.md
Expand Up @@ -20,6 +20,7 @@ glab mr create [flags]
-h, --help help for create
-l, --label string Add label by name. Multiple labels should be comma separated
-m, --milestone int add milestone by <id> for merge request (default -1)
--no-editor Don't open editor to enter description. If set to true, uses prompt. Default is false
--remove-source-branch Remove Source Branch on merge
-s, --source-branch string Source Branch for merge request
-g, --target-branch string Target Branch for merge request
Expand All @@ -37,4 +38,4 @@ glab mr create [flags]

* [glab mr](glab_mr.md) - Create, view and manage merge requests

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_mr_delete.md
Expand Up @@ -32,4 +32,4 @@ $ glab delete 123

* [glab mr](glab_mr.md) - Create, view and manage merge requests

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_mr_issues.md
Expand Up @@ -32,4 +32,4 @@ $ glab mr issues 46

* [glab mr](glab_mr.md) - Create, view and manage merge requests

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_mr_list.md
Expand Up @@ -32,4 +32,4 @@ glab mr list [flags]

* [glab mr](glab_mr.md) - Create, view and manage merge requests

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_mr_merge.md
Expand Up @@ -32,4 +32,4 @@ glab mr merge <id> [flags]

* [glab mr](glab_mr.md) - Create, view and manage merge requests

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020
30 changes: 30 additions & 0 deletions docs/glab_mr_note.md
@@ -0,0 +1,30 @@
## glab mr note

Add a comment or note to merge request

### Synopsis

Add a comment or note to merge request

```
glab mr note <merge-request-id> [flags]
```

### Options

```
-h, --help help for note
-m, --message string Comment/Note message
```

### Options inherited from parent commands

```
-R, --repo string Select another repository using the OWNER/REPO format or the project ID. Supports group namespaces
```

### SEE ALSO

* [glab mr](glab_mr.md) - Create, view and manage merge requests

###### Auto generated by spf13/cobra on 15-Aug-2020
29 changes: 29 additions & 0 deletions docs/glab_mr_rebase.md
@@ -0,0 +1,29 @@
## glab mr rebase

Automatically rebase the source_branch of the merge request against its target_branch.

### Synopsis

If you don’t have permissions to push to the merge request’s source branch - you’ll get a 403 Forbidden response.

```
glab mr rebase <id> [flags]
```

### Options

```
-h, --help help for rebase
```

### Options inherited from parent commands

```
-R, --repo string Select another repository using the OWNER/REPO format or the project ID. Supports group namespaces
```

### SEE ALSO

* [glab mr](glab_mr.md) - Create, view and manage merge requests

###### Auto generated by spf13/cobra on 15-Aug-2020
2 changes: 1 addition & 1 deletion docs/glab_mr_reopen.md
Expand Up @@ -26,4 +26,4 @@ glab mr reopen <id> [flags]

* [glab mr](glab_mr.md) - Create, view and manage merge requests

###### Auto generated by spf13/cobra on 14-Aug-2020
###### Auto generated by spf13/cobra on 15-Aug-2020

0 comments on commit a916922

Please sign in to comment.