6 ms·
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: ..
by apgwoz 17y ago
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.
- jtg 17y agoFor 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
- slig 17y agoCan be done with one line of cat and grep. So why did you bother to reinvent the wheel in a python script?
- apgwoz 17y agoWhy 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.
- slig 17y agoI 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.
- spectre 17y agocat <file> | grep "TOFIX\|TODO"
- run4yourlives 17y agoSome editors (Komodo) do this for you.