Forgotten TO-DO’s

I’m not sure about all the rest of the Developers out there but my biggest problem is coming back to finish TO-DO’s.

I have always marked temporary code hacks, or code that needed improvement with a // ::TO-DO:: {description of issue}.

I finally got sick of going through old code and seeing multiple ::TO-DO:: blocks.

I wrote this tiny shell script and run it nightly from cron.

#!/bin/sh
echo "Starting ::TO-DO:: Search for (project)"
echo ""
grep -r -n "::TO-DO::"  (/PATH/TO/PROJECT/FILES/) (/PATH/TO/PROJECT/FILES1) (/PATH/TO/PROJECT/FILES2) -B1 -A3

Just ensure there is an email address for the cron output or you will have to pipe greps output to mail, mailx, mutt, or something similar.

The -r flag tells grep to search recursively for each path.
The -n flag adds line numbers on the offending line.
The -B1 and -B3 adds the prior line and three following lines to the output.

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
Share
You can leave a response, or trackback from your own site.

Leave a Reply

Comments links could be nofollow free.

Twitter Delicious Facebook Digg Stumbleupon Favorites More