Skip to main content

Multi-language TODO comment extractor written in Rust.

Project description

Rusty TODO.md — A Pre-Commit Hook & CLI for Managing TODOs

PyPI - Version PyPI - Python Version License: MIT

Rusty TODO.md helps you find, centralize, and maintain all your TODO comments across your codebase. It can run as a pre-commit hook or from the CLI, automatically extracting TODO-style comments into a structured TODO.md file.

Supports a wide range of languages and file types, with sectioned formatting, multi-line support, and smart sync.


📌 Recommended usage: Pre-commit via shim repo

When pre-commit installs a hook from a Git repo, it runs pip install . from that repo — which would normally build Rusty TODO.md from source (requiring a Rust toolchain).

The shim repository (rusty-todo-md-pre-commit) solves this by depending on the rusty_todo_md PyPI package, ensuring prebuilt wheels are used.

Add this to your .pre-commit-config.yaml:

repos:
  - repo: https://github.com/simone-viozzi/rusty-todo-md-pre-commit
    rev: v1.9.1  # Use the latest upstream tag (shim mirrors upstream)
    hooks:
      - id: rusty-todo-md
        args: ["--auto-add", "--markers", "TODO", "FIXME", "HACK"]
        language_version: python3.11
  • args customise the markers to scan for and enable --auto-add to stage TODO.md automatically.
  • language_version forces the hook to run with a specific Python interpreter.

Then install the hook:

pre-commit install

✅ No Rust toolchain is required when using the shim and a supported platform.


⚙️ CLI installation

You can also install Rusty TODO.md directly for manual CLI use:

pip install rusty_todo_md

Then run:

rusty-todo-md --help

✨ Key Features

  1. Automatic TODO Collection By default, Rusty TODO.md scans the files passed to it (typically staged files from pre-commit) for markers like TODO and FIXME, and updates your TODO.md with any new entries.

  2. Sectioned TODO.md Format The TODO.md file is now organized into sections, grouped first by marker (e.g., # TODO, # FIXME), then by file. Each marker section begins with a header (# <MARKER>), each file with a sub-header (## <file-path>), followed by a list of extracted TODO items.

  3. Multi-line TODO Support Handles multi-line and indented TODO comments, merging them into a single entry.

  4. Sync Mechanism

    • Automatically merges new TODO entries with existing ones, using an internal representation.
    • Removes entries when their corresponding TODOs are no longer present in the source code.
  5. Language-Aware Parsing Supports precise parsing for Python, Rust, JavaScript, and Go out-of-the-box, with plans for additional languages such as TypeScript, PHP, and Java.

  6. Seamless Pre-Commit Integration Easily integrate Rusty TODO.md into your workflow by adding it to your .pre-commit-config.yaml.

  7. Auto-stage Updated TODO.md With the --auto-add flag, the tool can automatically stage the TODO.md file after updates.


🧩 CLI usage

Scan staged files

rusty-todo-md

Use multiple markers

rusty-todo-md --markers TODO FIXME HACK

Specify files to process with markers

When using --markers as the last option before specifying files, use -- to separate markers from files:

rusty-todo-md --markers TODO FIXME HACK -- file1.rs file2.rs

Without the -- separator, the files would be incorrectly treated as additional markers.

Automatically stage TODO.md

rusty-todo-md --auto-add path/to/file.rs

Custom TODO.md path

rusty-todo-md --todo-path docs/TODOS.md

📝 Supported languages & extensions

Rusty TODO.md detects comment syntax based on file extension:

Language / Type Extensions
Python py
Rust rs
JavaScript / JSX js, jsx, mjs
TypeScript ts, tsx
Java java
C / C++ headers cpp, hpp, cc, hh
C# cs
Swift swift
Kotlin kt, kts
JSON json
Go go
Shell sh
YAML yml, yaml
TOML toml
Dockerfile dockerfile
Markdown md

Many extensions share the same parser (e.g., JS-style comment parsing for TS, Java, C-like languages).


🔍 Output format (stable)

Entries in TODO.md use this format:

* [path/to/file.ext:LINE](path/to/file.ext#L{LINE}): MESSAGE

This format is stable and designed for easy linking to code in hosted repos.

Example:

# TODO
## src/main.rs
* [src/main.rs:10](src/main.rs#L10): Refactor initialization logic

📦 Requirements & Supported Platforms

  • Python ≥ 3.10
  • No Rust toolchain needed if using the shim or PyPI wheels

Prebuilt wheels are published for:

OS / libc Architectures
Linux (manylinux) x86_64, x86, aarch64, armv7, ppc64le
Linux (musllinux) x86_64, x86, aarch64, armv7
Windows x64, x86
macOS x86_64 (macOS 13), aarch64 (macOS 14)

🛠 Troubleshooting

  • If no wheel is available for your platform, pip will try to build from source — which requires a Rust toolchain.
  • If you encounter build errors, please:
    1. Check the latest releases to confirm wheel availability.
    2. Open an issue with your OS/arch details.

👩‍💻 Development

If you want to run Rusty TODO.md directly from the main repo via pre-commit (building from source):

repos:
  - repo: https://github.com/simone-viozzi/rusty-todo-md
    rev: v1.7.5
    hooks:
      - id: rusty-todo-md

⚠️ This will compile the Rust source and requires a working Rust toolchain.


🤝 Contributing

Contributions are welcome!

  • Open an issue for bug reports or feature requests.
  • Submit a pull request with improvements, new parsers, or fixes.

📚 Links


⚖️ License

Licensed under the MIT License.


❤️ Support

If you find Rusty TODO.md helpful, please consider giving it a ⭐ on GitHub to help others discover the project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rusty_todo_md-1.9.2.tar.gz (93.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rusty_todo_md-1.9.2-py3-none-win_amd64.whl (1.7 MB view details)

Uploaded Python 3Windows x86-64

rusty_todo_md-1.9.2-py3-none-win32.whl (1.5 MB view details)

Uploaded Python 3Windows x86

rusty_todo_md-1.9.2-py3-none-musllinux_1_2_x86_64.whl (1.8 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

rusty_todo_md-1.9.2-py3-none-musllinux_1_2_i686.whl (1.8 MB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

rusty_todo_md-1.9.2-py3-none-musllinux_1_2_armv7l.whl (1.6 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARMv7l

rusty_todo_md-1.9.2-py3-none-musllinux_1_2_aarch64.whl (1.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

rusty_todo_md-1.9.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

rusty_todo_md-1.9.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

rusty_todo_md-1.9.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (1.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

rusty_todo_md-1.9.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

rusty_todo_md-1.9.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

rusty_todo_md-1.9.2-py3-none-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

rusty_todo_md-1.9.2-py3-none-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file rusty_todo_md-1.9.2.tar.gz.

File metadata

  • Download URL: rusty_todo_md-1.9.2.tar.gz
  • Upload date:
  • Size: 93.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.4

File hashes

Hashes for rusty_todo_md-1.9.2.tar.gz
Algorithm Hash digest
SHA256 c4bd6886cc274ebb98c3c439ec9e7427ef6d47774e98dba1584e40fcf4712e85
MD5 69547a8d9834cce560b208c518ee02d7
BLAKE2b-256 a3044c71ab75d3fa00041536918443c4621c0260d8af6d7dbebc91e95532952a

See more details on using hashes here.

File details

Details for the file rusty_todo_md-1.9.2-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for rusty_todo_md-1.9.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 7ec1d08c448f7c0cd3717cfbc69725e3d121d7c44ce2818ecb32edea7af1fc3b
MD5 c7a89195a829df139d458f94ae322396
BLAKE2b-256 b773f68f1f835144c0fedb180ee69d2de877559b11a14d36daed6865273afc33

See more details on using hashes here.

File details

Details for the file rusty_todo_md-1.9.2-py3-none-win32.whl.

File metadata

File hashes

Hashes for rusty_todo_md-1.9.2-py3-none-win32.whl
Algorithm Hash digest
SHA256 5f999b2c78ea4fcb1fbe7f681eda880483c74512041d386de9ba686b6d8abaca
MD5 d54ac5d21be116aba815ea76432d7c82
BLAKE2b-256 c219819fd9bd96ba76eb64e7f7953879105e6ab3086664b3b192464e77ce586d

See more details on using hashes here.

File details

Details for the file rusty_todo_md-1.9.2-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rusty_todo_md-1.9.2-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5a0dfdafd633117da805d2bb84a172da65dd4b91624bf534f3e3456f1fa18c5b
MD5 dcdcbb91d82dce9908baeccc9f2e636a
BLAKE2b-256 68fffdd3e5bbcb4ff75c56a2fdae9b97cf0ffe6f0cdda22151bad0e7ce948bbc

See more details on using hashes here.

File details

Details for the file rusty_todo_md-1.9.2-py3-none-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for rusty_todo_md-1.9.2-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 cc62a15dcc4c44f1ed15a5dc41282f98f253d8c6d06a9098f60f5a225182db98
MD5 4767d129ab03741a20d7dd7d6062947e
BLAKE2b-256 1ca38e95f009aee6df2e43ae2d3687273f7ee1d7c7ff4815a62e8abd14cbc94e

See more details on using hashes here.

File details

Details for the file rusty_todo_md-1.9.2-py3-none-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for rusty_todo_md-1.9.2-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 d4198f8cdd73fe789c19f7f9748cfa35fb19a23f4b174f0100cb0aa53c8d18c4
MD5 34c6e057ddd2ea956136aeb5e5a39910
BLAKE2b-256 52339de2c9031c8201424dd4c5d8d35da9cb6219f23b7bb2983c6262ca1fcb9d

See more details on using hashes here.

File details

Details for the file rusty_todo_md-1.9.2-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for rusty_todo_md-1.9.2-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 02473eae95de3dc33027bc92e410e97ba9e1c170ad5ac42e69da58c58ad41b92
MD5 d6b5ad550ee48fe6c80b3f00cd78f498
BLAKE2b-256 1988d7286e9b16014b3777a8be8a9d4dba310b3e0f201cab9fbbea04fd02d40a

See more details on using hashes here.

File details

Details for the file rusty_todo_md-1.9.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rusty_todo_md-1.9.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fd9c47e98f4a42981b42441a5662621e0667b3cd273e3ba4eadb45c881133cdc
MD5 cb771164b73f3df2352219c97f2c8a78
BLAKE2b-256 e5ad88e896f84faca777f08bdb2574b9e70f46e3c627e73c841af3e6ce07e98c

See more details on using hashes here.

File details

Details for the file rusty_todo_md-1.9.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for rusty_todo_md-1.9.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 13c1792c7c644e72288342ce42137ce9439e72a17be805cfe4af564ce8fd6e54
MD5 2a21571df9abc5d742b5cd199680e416
BLAKE2b-256 0d489062659397ffa480370156db68b82222866f9759746c49d296a2c336d83a

See more details on using hashes here.

File details

Details for the file rusty_todo_md-1.9.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for rusty_todo_md-1.9.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 9256832f3cd15e259fd202dc7136384dc68e52577feab80c76a0d5e4ea5f759f
MD5 c8ee1f7e9d0c63d9e8866cb52eeacc7b
BLAKE2b-256 87f1efcb4541e7615cc8d36895925eb04c44da357f305888d2f155b18487c394

See more details on using hashes here.

File details

Details for the file rusty_todo_md-1.9.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for rusty_todo_md-1.9.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 e8a92bdb19cae6ea312a636cea5f4b80cf4963d2de5ed48c69fc3dbe4715eea7
MD5 c4f676f01c7e8216241e5c047b6bcaa8
BLAKE2b-256 8a3b8ea5658ff66f4e2b89a65eba4b6b40c88b182cfd22728c06d41f4f8520c0

See more details on using hashes here.

File details

Details for the file rusty_todo_md-1.9.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rusty_todo_md-1.9.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d1525d29535f31705f652a3cc3728064b2da6e69cbaf8c1c53f52031e52c6739
MD5 6cdc5974e7d9f1e9f71f004ab0692fc4
BLAKE2b-256 f15a4809fc574d34a4506c360b480ef61e56f080e7a85ae07793feb51a8d3f1f

See more details on using hashes here.

File details

Details for the file rusty_todo_md-1.9.2-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rusty_todo_md-1.9.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d0801b3cede8016b66db3889d1f4bf244234c32e0a2952fafa9a5bca82a4dd56
MD5 9a5c13d7dc591009910f73eefbfe0930
BLAKE2b-256 5656943e034eeb005e6dfd903af13f2dca4a66dbb15eb4ecd444b99d59849cfe

See more details on using hashes here.

File details

Details for the file rusty_todo_md-1.9.2-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rusty_todo_md-1.9.2-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6c85f0c5ee272a6764f546bd16aa4c96096fe261df77c390633a1671fe04d77f
MD5 6f999c9e38be4a6fe4d55cb31227caa5
BLAKE2b-256 8b8caf84f44adcbb6ce4234b7d64e0850719e455b2bf8c2f03f4f8391f84656f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page