awds_q
Last Updated: February 25, 2016
·
757
· chrissimpkins
Cs ava

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.

Say Thanks
Respond

4 Responses
Add your response

14309
D42a7264714dee5006b9c99d2567a320

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

over 1 year ago ·
14315
Cs ava

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

over 1 year ago ·
15614
5404ada11a0640e75e7ef5c3ac58472c

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 ·
15683
Cs ava

Thanks! I will check it out. -C

over 1 year ago ·
Filed Under