Last Updated: February 25, 2016
·
1.044K
· chrissimpkins

Source Code TODO Logs

This one-liner parses your source file for TODO comments (works with any comment indicator character(s)) and prints the message by line number to the standard output stream:

Usage

awk '/TODO/ {print NR "\t" ($1=$2="") $0}' <source filepath>

Example

Source

#!/usr/bin/env python
# encoding: utf-8
# file: pydoc.py

## TODO this needs a lot of this and that
class PythonThreeDocCommand(sublime_plugin.TextCommand):

...

## TODO wow, did I really release it like this?
class PythonTwoDocCommand(sublime_plugin.TextCommand):

Command Line

$ awk '/TODO/ {print NR "\t" ($1=$2="") $0}' pydoc.py
10    this needs a lot of this and that
39    wow, did I really release it like this?

Modify the /TODO/ regular expression in the awk script as needed for your own TODO comment format.

4 Responses
Add your response

There's a neat SublimeText plugin for that: https://github.com/jonathandelgado/SublimeTodoReview

over 1 year ago ·

Thanks Dmitry. I will check it out. Appreciate the link. -C

over 1 year ago ·

If you need a bit more than a simple TODO list, I highly recommend Watson for inline issue/todo handling. It's able to post issues to GitHub/Bitbucket/GitLab/Asana, it has colorized output and other neat features :)

http://goosecode.com/watson/

over 1 year ago ·

Thanks! I will check it out. -C

over 1 year ago ·