Converting TODOs to Tickets?

March 15, 2009 at 03:08 PM | Uncategorized | View Comments

I work on a lot* of projects which are too small to warrant a full-blown bug tracker (DrProject, Trac, etc), but too big to keep track of bugs/TODOs "just" in code. So I got thinking:

Would it be useful to have a tool that would take the 'TODO' and 'XXX' comments strewn around the code, then track them in one central place?

For example, given the code:

int foo(char *bar){
    void *baz; // XXX: Why do we need this?
    baz = bar;
    if (check(baz) < 0)
        // TODO: Better error checking
        printf("uh oh -- check broke.\n"), exit(42); 
    return 16;
}

Would generate a "TODO" file like this:

- foo.c: line 42 in function 'foo' (XXX001):
    int foo(char *bar){
        void *baz; // XXX: Why do we need this?
        baz = bar;

- foo.c: line 45 in function 'foo' (TODO001):
    if (check(baz) < 0)
        // TODO: Better error checking
        printf("uh oh -- check broke.\n"), exit(42);

And with the liberal use of a 'tags' file, it could even fake editor integration (eg, jumping to tag 'TODO001' would take you to line 45 in foo.c).

So, what do you, the Internet, think? Would this tool be more useful than grep?

*: read "a few"