Crates.io | todo-to-issue |
lib.rs | todo-to-issue |
version | 0.1.1 |
source | src |
created_at | 2019-07-27 21:12:18.389318 |
updated_at | 2019-07-28 21:24:22.603499 |
description | CLI tool that converts forgotten TODO comments into actionable GitHub issues. |
homepage | https://github.com/sergeichestakov/todo-to-issue/ |
repository | https://github.com/sergeichestakov/todo-to-issue/ |
max_upload_size | |
id | 152206 |
size | 29,500 |
CLI tool that converts forgotten TODO comments into actionable GitHub issues.
brew tap sergeichestakov/taproom
brew install todo-to-issue
wget https://github.com/sergeichestakov/todo-to-issue/raw/master/dist/todo-to-issue_amd64.deb
sudo dpkg -i todo-to-issue_amd64.deb
cargo install todo-to-issue
Make sure ${HOME}/.cargo/bin
is in your PATH to be able to run installed binaries.
Make sure you generate a Personal Access Token on GitHub with public_repo
or repo
scope.
cd
into the directory you want to inspect. Make sure it's a git repository and the remote has issues enabled.
Run todo-to-issue $TOKEN
where $TOKEN
is your personal access token. Alternatively, you can run the command without the token argument which will prompt you to paste it into a hidden password input. If you're just doing a dry run (-n
flag), you don't need a token at all.
Running this command will read every file tracked by git for TODO comments, generating a title and body for each one. Then, for every TODO found, it will prompt you with the following options:
1. Open Issue
2. Edit Issue
3. Skip Issue
4. Exit
Open Issue
will create a new GitHub issue with a TODO
label, based on the generated title and body.By default, the title here is simply the rest of the comment after
TODO:
and the description contains the line and file the comment appears in.
Edit Issue
will open your default editor and allow you to change the title and body before opening the issue. The only restriction here is that the edited issue must be of the following format:Title: Your one line title here.
Body: Your description here.
This can span multiple lines and include markdown just like normal GitHub issues.
Everything after the second line is considered part of the description so this can be arbitrarily long.
In other words, the first line must begin with
Title:
and the second must begin withBody:
. This is just to make parsing easier and will not be included as part of your Issue. If the file contains an invalid format when you save and quit, the issue will not be created. You can also quit without saving to move on to the next comment without creating an issue.
Skip
will move on to the next comment found.
Exit
will terminate the program.
If you're not doing a dry run, running this command will also query all of the previous GH issues (open and closed) with the TODO
label. If any of them have the same title, they will be ignored. This is to prevent creating multiple GH issues for the same comment.
Note: This also means the output of a dry run is the actual amount of TODO comments found, as opposed to the default behavior which outputs the number of TODO comments that do not match the title of an existing issue with a
TODO
label in the remote repository.
Option | Description |
---|---|
-n, --dry-run |
Outputs the number of TODOs without opening any issues. |
-h, --help |
Prints help information. |
-p, --pattern "<PATTERN>" |
Sets a glob pattern to narrow search for TODO comments to specific files. |
-V, --version |
Prints version information. |
-v, --verbose |
Makes output more descriptive. |
Make sure you have Rust installed.
On Linux you also have to install OpenSSL via sudo apt-get install pkg-config libssl-dev
. See the docs for more.
git clone https://github.com/sergeichestakov/todo-to-issue.git
cd todo-to-issue
cargo build
# Running the program and passing params
cargo run -- $TOKEN -n -v
# To test on other repos create a symlink
sudo ln -s $PWD/target/debug/todo-to-issue /usr/local/bin
cd ../another_repo
todo-to-issue $TOKEN