extract-todo is a simple commandline tool for the extraction of TODOs. It can extract TODOs from single-line-comments like:
# TODO something todo
It prints the file, line number and the TODO text.
You need python3+ to run this tool. It can be installed from pypi with
pip install extract-todo
You can use this tool with the command
python -m extract_todo /path/to/file
or
extract-todo /path/to/file
It prints the filename, line number and the TODO text. Example output:
.\tests\files\test.py
LINE 1: test
LINE 5: test 2
Note that if you want to run this tool on all the Python files in your git-managed project, you could do something like this:
git ls-files '**/*.py' -z | xargs -0 extract-todo | cat -s
To make this really easy for everyone using your repo, you could add a Makefile
target that does this automatically:
.PHONY: extract-todo
extract-todo:
git ls-files '**/*.py' -z | xargs -0 extract-todo | cat -s
Copyright (C) Jens Wilberg July 2021
extract_todo.py is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
extract_todo.py is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with extract_todo.py. If not, see <http://www.gnu.org/licenses/>.