Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I started building a script to go through source code and find all the things I tag "TOFIX" or "TODO." For example:

   $ python tofix.py tofix.py
   line 3: ...
   line 16: this needs some attention as we shouldn't be 
   using 'pass' notice this is indented slightly more than 
   the TOFIX line above and should be included in the TOFIX.
I haven't had time to work on it anymore, but you're welcome to work on it if you'd like. I can send you the source I have. My username at gmail. Ideally it'd be able to remove them as I fixed things. So I might say tofix fixed 3 and it'd remove the "TOFIX: ..." at line 3.


Can be done with one line of cat and grep. So why did you bother to reinvent the wheel in a python script?


Why yes, you happen to be correct. It can be done with cat and grep, and really you can do it without cat! However, it's perhaps desirable to be able to do things like edit the todo/tofix, delete them, export them to your todo application of choice, etc, etc, etc, etc. So, while you're correct in that you certainly can do it with grep, you're severely limiting yourself if you choose to.


I didn't read this when I posted, sorry.

> Ideally it'd be able to remove them as I fixed things. So I might say tofix fixed 3 and it'd remove the "TOFIX: ..." at line 3.


cat <file> | grep "TOFIX\|TODO"


For those of you who work in Rails, there are a couple of rake tasks that do this already. I just found out myself while mucking around a couple of days ago.

rake notes:todo

and

rake notes:fixme


Some editors (Komodo) do this for you.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: