Github-Todos – Git hook to convert your TODOs into Github issues
github.com
github.com
Once question, once a TODO is removed from the repository, is the issue also automatically closed? Or vice-versa? Would be cool if the two were coupled, so that there aren't dangling TODOs left in the repository once the issue has been addressed in some fashion.
When issue is closed :
— it detects TODOs anywhere, not necessarily in comments, it could destroy some code (same for 'inject-issue' but here it would be a removal, can be tougher) — maybe a TODO previously related to this issue will have to be modified instead of deleted, how should it handle it?
When TODO is removed :
— should I close issue directly or check in the whole codebase if it still exists somewhere and keep it open?
Many questions arise and I still found no harmless answers :(
But it definitely should help you track it both ways, with a command "stat" for example that would report you any actions you should achieve, and even interactively do it for you. But I don't think it will happen in hook itself yet.
I want all ideas available here ;) should create an issue for open discussion.
Put some sort of tag in the todo comment to represent a change. e.g. // TODO: Fix this issue #complete
At commit time, the hook will see the tag changed, reference the commit in the issue, and then auto-close it.
I think that any automation should affect issues and not involve directly changing code. So, it might be interesting to have a toggle to automatically close issues after scanning the repo for the presence of TODOs. I do think that this should be a toggle that can be switched on or off.
This reminds me of watson (https://github.com/nhmood/watson-ruby) which manages TODOs pretty well (with GH support) but doesn't generate the hooks for you unfortunately.
Totally awesome!
Note that it can open or comment issues (matching based on TODO's text == issue's title), but it does not yet closes them, because I couldn't find a satisfying workflow yet (which means it may never occur).
Give it a try on a sample repository, always needing more testers !
An IDE plugin could do the trick nicely too (create an issue by right-clicking on a TODO for example). But a git hook is more portable.
In fact the first prototype was a shell script using grep and ghi (https://github.com/stephencelis/ghi).
Anyway, it depends on your workflow, if you already have the right tools and habits no to lose your TODOs in your deep code, Github-Todos is obviously of no use for you!
Are GitHub issues portable?
But definitely, if you find it useless, then it certainly is for you! I was just telling why others could find it useful :)
I didn't say that. :/