Searching code for "TODO" comments with git grep
07 Oct 2012 by Yuri PrezumentMy code, like most code, tends to contain TODO/FIXME comments for things that I don't want to bother with at the time of writing them. Sometimes, these tend to pile up. A quick method of finding them is git grep:
$ git grep TODO
Today I was looking for "TODO" annotations in an old project and completely missed a couple of FIXMEs due to being too lazy to grep for them. This would have caught them:
$ git grep -e TODO -e FIXME
But that's too much typing. So why not make an alias for it?
[alias]
todo = grep -n -e TODO -e FIXME -e XXX -e OPTIMIZE
And then...
$ git todo
celeryconfig.py:7: # TODO: find best schedule to avoid query limits
models.py:38: # FIXME: remove this method soon
Ok, that was fun. Back to work...
Notes:
- On a general note - don't let TODOs and FIXMEs pile up in the first place. If it's easy to fix - fix it. If not, document it or open an issue.
Django Bash completion
A couple of days ago, while browsing the Django repository on Github, I discovered the django_bash_completion script (only took me 2 years to find it). Shortly after the mind=blown moment, I tested it and was amazed by the results, or rather by the fact that I never knew it ...
read moreRunning a Bottle app with Gunicorn
Setting Up
I decided to set up this blog mainly as an experiment.
I might write some Python and software dev related posts sometime soon.
This blog is powered by Pelican, the posts are written in reStructuredText and it's hosted on Github Pages.
I'm keeping the source repository separate from ...
read more