The tool extracts TODO tags denoted by # TODO
of Python files (.py
) and stores found tags in an output file. The input directory to process and the output filename can be passed via command line arguments. In addition, you can specify a command to open the output file if desired.
There are many great extensions to handle TODO tags for common editors like VS Code (e.g. Todo Tree) or Sublime Text (e.g. TodoReview). However, I was looking for an easy way to handle and sort more detailed tags throughout a given project folder and save them in a file for later usage or as a reference. Detailed TODO tags look like this:
# TODO: Refactoring: ...
# TODO: Feature: ...
# TODO: Improvement: ...
All tags are sorted upon filename, additional tag (Refactoring
, Feature
...) and the line number which # TODO
was found in. Tag and tag description are separated by a single colon. You can provide any string as an additional tag, a complete TODO tag needs to be formatted in the following form:
# TODO: <additional tag>: <description>
Input directory and output file name containing all found TODO tags can be specified as command line arguments. The output file generated by the tool can be opened by passing an additional command (e.g. code
to open the file with VS Code). Use flag --help
for futher information.
Using pandas
in this little tool is definitely over-engineering, but was obviously the solution, since it is part of my default working environment.