this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

✨ Add github.com support

+44 -14
+16 -14
README.md
··· 2 2 3 3 Deal with your client's feedback efficiently by creating a bunch of issues in bulk from a text file. 4 4 5 - Only supports gitlab for now. 5 + ## Supported platforms 6 6 7 - Requires `glab`. 7 + - Gitlab (including custom instances): requires [`glab`](https://gitlab.com/gitlab-org/cli#installation) to be installed 8 + - Github: requires [`gh`](https://github.com/cli/cli#installation) to be installed 8 9 9 10 ## Installation 10 11 ··· 14 15 15 16 ## Usage 16 17 18 + The command needs to be run inside of the git repository (this is used to detect if the repository uses github or gitlab) 19 + 17 20 ``` 18 21 issurge [options] <file> [--] [<glab-args>...] 19 22 issurge --help 20 23 ``` 21 24 22 - - **<glab-args>** contains arguments that will be passed as-is to every `glab` command. 25 + - **&lt;glab-args&gt;** contains arguments that will be passed as-is to every `glab` command. 23 26 24 27 ### Options 25 28 ··· 34 37 - **Tags:** Prefix a word with `~` to add a label to the issue 35 38 - **Assignees:** Prefix with `@` to add an assignee. The special assignee `@me` is supported. 36 39 - **Milestone:** Prefix with `%` to set the milestone 37 - - **Comments:** You can add comments by prefixing a line with `//` 40 + - **Comments:** You can add comments by prefixing a line with `//` 38 41 - **Description:** To add a description, finish the line with `:`, and put the description on another line (or multiple), just below, indented once more than the issue's line. Exemple: 39 - ``` 40 - My superb issue ~some-tag: 41 - Here is a description 42 42 43 - I can skip lines 44 - Another issue 45 - ``` 43 + ``` 44 + My superb issue ~some-tag: 45 + Here is a description 46 + 47 + I can skip lines 48 + Another issue 49 + ``` 46 50 47 - Note that you cannot have indented lines inside of the description (they will be ignored). 51 + Note that you cannot have indented lines inside of the description (they will be ignored). 48 52 49 53 #### Add some properties to multiple issues 50 54 51 55 You can apply something (a tag, a milestone, an assignee) to multiple issues by indenting them below: 52 56 53 57 ``` 54 - One issue 58 + One issue 55 59 56 60 ~common-tag 57 61 ~tag1 This issue will have tags: ··· 61 65 62 66 Another issue. 63 67 ``` 64 - 65 -
+28
issurge/parser.py
··· 74 74 return result 75 75 76 76 def submit(self): 77 + remote_url = urlparse( 78 + subprocess.run(["git", "remote", "get-url", "origin"]).stdout.decode() 79 + ) 80 + if remote_url.hostname == "github.com": 81 + self._github_submit() 82 + else: 83 + self._gitlab_submit() 84 + 85 + def _gitlab_submit(self): 77 86 command = ["glab", "issue", "new"] 87 + if self.title: 88 + command += ["-t", self.title] 89 + command += ["-d", self.description or ""] 90 + for a in self.assignees: 91 + command += ["-a", a if a != "me" else "@me"] 92 + for l in self.labels: 93 + command += ["-l", l] 94 + if self.milestone: 95 + command += ["-m", self.milestone] 96 + command.extend(self._cli_options["<glab-args>"]) 97 + if self._cli_options["--dry-run"] or self._cli_options["--debug"]: 98 + print( 99 + f"{'Would run' if self._cli_options['--dry-run'] else 'Running'} [white bold]{subprocess.list2cmdline(command)}[/]" 100 + ) 101 + if not self._cli_options["--dry-run"]: 102 + subprocess.run(command) 103 + 104 + def _github_submit(self): 105 + command = ["gh", "issue", "new"] 78 106 if self.title: 79 107 command += ["-t", self.title] 80 108 command += ["-d", self.description or ""]