A simple tool that collects TODOs in the source code and reports them as GitHub issues.
- Snitch finds an unreported TODO,
- Reports it to the GitHub as an issue,
- Assigns the Issue number to the TODO marking it a reported,
- Commits the reported TODO to the git repo,
- Repeats the process until all of the unreported TODOs are reported.
After that you are supposed to push the new reported TODOs yourself.
// TODO: rewrite this in Rust
Regular expression: ^(.*)TODO: (.*)$ Play
Capture Groups:
- Group 1: Prefix. Used only to precisly recover the text of the line where the TODO is originally located.
- Group 2: Suffix. Used as the title of the issue.
// TODO(#42): rewrite this in Rust
Regular expression: ^(.*)TODO\((.*)\): (.*)$ Play
Capture Groups:
- Group 1: Prefix. Used only to precisly recover the text of the line where the TODO is originally located.
- Group 2: ID. The number of the Issue.
- Group 3: Suffix. Used as the title of the issue.
// TODO: rewrite this in Rust
// I honestly think Rust is going to be around forever,
// I really do. I think this is like, this is the formation
// of Ancient Greek.
// © https://www.reddit.com/r/programmingcirclejerk/comments/ahmnwa/i_honestly_think_rust_is_going_to_be_around/
- Snitch remembers the TODO's prefix.
- Snitch parses all of the consecutive lines with the same prefix as the body.
- The body is reported as the Issue Description.
$ go get github.com/tsoding/snitchSnitch obtains credentials from two places: (default) environment variable or file.
export GITHUB_PERSONAL_TOKEN = <personal-token> which can be added to .bashrc
Resides in $HOME/.snitch/github.ini
[github]
personal_token = <personal-token>Checkout GitHub Help on how to get the Personal Access Token.
Make sure to enable full access to private repos. For some reason it's required to post issues.
For usage help just run snitch without any arguments:
$ ./snitchYou don't have to use TODO as the keyword of a todo you want to
"snitch up". The keyword is customizable through .snitch.yaml
config:
keywords:
- TODO
- FIXME
- XXX
- "@todo"You can apply project local issue title transformations. Create
.snich.yaml file in the root of the project with the following
content:
title:
transforms:
- match: (.*) \*/
replace: $1This feature is very useful for removing garbage from the Issue
Titles. Like */ at the end of C comments.
$ export GOPATH=$PWD
$ go get .
$ go build .You can support my work via
- Twitch channel: https://www.twitch.tv/subs/tsoding
- Patreon: https://www.patreon.com/tsoding