Multi-language TODO comment extractor written in Rust.
Project description
Rusty TODO.md — A Pre-Commit Hook & CLI for Managing TODOs
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
argscustomise the markers to scan for and enable--auto-addto stageTODO.mdautomatically.language_versionforces the hook to run with a specific Python interpreter.
Example with exclusions:
repos:
- repo: https://github.com/simone-viozzi/rusty-todo-md-pre-commit
rev: v1.9.1
hooks:
- id: rusty-todo-md
args:
- "--auto-add"
- "--markers"
- "TODO"
- "FIXME"
- "HACK"
- "--exclude-dir"
- "node_modules"
- "--exclude-dir"
- "target"
- "--exclude"
- "**/*.test.js"
- --
language_version: python3.11
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
-
Automatic TODO Collection By default, Rusty TODO.md scans the files passed to it (typically staged files from pre-commit) for markers like
TODOandFIXME, and updates yourTODO.mdwith any new entries. -
Sectioned TODO.md Format The
TODO.mdfile 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. -
Multi-line TODO Support Handles multi-line and indented TODO comments, merging them into a single entry.
-
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.
-
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.
-
Seamless Pre-Commit Integration Easily integrate Rusty TODO.md into your workflow by adding it to your
.pre-commit-config.yaml. -
Auto-stage Updated TODO.md With the
--auto-addflag, the tool can automatically stage theTODO.mdfile 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
Exclude files and directories
Rusty TODO.md supports glob-based exclusion patterns to filter out files and directories from TODO extraction.
Exclude specific files or patterns
# Exclude all log files
rusty-todo-md --exclude "*.log"
# Exclude specific file
rusty-todo-md --exclude "config.rs"
# Exclude files in a specific directory
rusty-todo-md --exclude "src/generated/*"
Exclude directories
# Exclude a directory (and all files within it)
rusty-todo-md --exclude-dir "build"
# Or use --exclude with trailing slash
rusty-todo-md --exclude "build/"
# Exclude multiple directories
rusty-todo-md --exclude-dir "node_modules" --exclude-dir "target"
Recursive exclusion with wildcards
# Exclude all files under src/ recursively
rusty-todo-md --exclude "src/**"
# Exclude all .test.js files anywhere in the tree
rusty-todo-md --exclude "**/*.test.js"
# Exclude all 'vendor' directories at any depth
rusty-todo-md --exclude-dir "**/vendor"
Multiple exclusion patterns
# Combine multiple exclusions
rusty-todo-md \
--exclude "*.log" \
--exclude "*.tmp" \
--exclude-dir "build" \
--exclude-dir "dist" \
--markers TODO FIXME
Glob pattern syntax
*— matches any sequence of characters within a single path component?— matches any single character**— matches zero or more path components (recursive)/suffix — indicates directory-only matching (when used with--exclude)
Note: Patterns are matched relative to the scan root. The
--exclude-dirflag automatically ensures directory-only matching.
📝 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 15), aarch64 (macOS 14) |
🛠 Troubleshooting
- If no wheel is available for your platform,
pipwill try to build from source — which requires a Rust toolchain. - If you encounter build errors, please:
- Check the latest releases to confirm wheel availability.
- 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
- Shim repo (recommended for pre-commit): rusty-todo-md-pre-commit
- PyPI package: rusty_todo_md
- Releases: GitHub Releases
⚖️ 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rusty_todo_md-1.10.2.tar.gz.
File metadata
- Download URL: rusty_todo_md-1.10.2.tar.gz
- Upload date:
- Size: 100.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
917d28f07e91c12eb8d15062daa221235367212ce73e4c272b0b0b15b20bc26a
|
|
| MD5 |
f8566df0a98d288dc525042788b683df
|
|
| BLAKE2b-256 |
77a228e4cbee488d131e194a045146f9ac6c03aec8a45b5082724023e7b7d145
|
File details
Details for the file rusty_todo_md-1.10.2-py3-none-win_amd64.whl.
File metadata
- Download URL: rusty_todo_md-1.10.2-py3-none-win_amd64.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7438f180fb7f81cec30e40b95fb741209dc70867180e165bb34e1346690ac387
|
|
| MD5 |
df6dcceb5fd7621626a0f232b2601309
|
|
| BLAKE2b-256 |
0aa804e8dea52f6d5aa446ed7ba50c80ca5c587eb1d6f6699ddc16cde5d95169
|
File details
Details for the file rusty_todo_md-1.10.2-py3-none-win32.whl.
File metadata
- Download URL: rusty_todo_md-1.10.2-py3-none-win32.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
feb60e00dbcbe1ce0387cc18f5af1c575ea22e36dde1a468eb2cebdcb27671bb
|
|
| MD5 |
dca4d3b707a94197f0f81dd7be69a5b6
|
|
| BLAKE2b-256 |
ab5ebeebef2ab89de427a9df80e107bdadbfe18b9e6f46d6a52f73f7cc306a31
|
File details
Details for the file rusty_todo_md-1.10.2-py3-none-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: rusty_todo_md-1.10.2-py3-none-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: Python 3, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9540d02b3b8f1177c4b6b118fa2d342f3ceb4ae404611364bcaee52877bb8561
|
|
| MD5 |
3f7802310ba5af00e0f5aad8a0b7a4d4
|
|
| BLAKE2b-256 |
67037e8fd31a5c8f618a2028b6784e4ac0c3759709a770256c0c5287501bfb01
|
File details
Details for the file rusty_todo_md-1.10.2-py3-none-musllinux_1_2_i686.whl.
File metadata
- Download URL: rusty_todo_md-1.10.2-py3-none-musllinux_1_2_i686.whl
- Upload date:
- Size: 1.9 MB
- Tags: Python 3, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25ee038af6d045b48c1d731a82d97faa0cb412e7cacba5f0d6827bf7df26c17b
|
|
| MD5 |
3910626938a82b1b64b1a1e4e2b8dd09
|
|
| BLAKE2b-256 |
919972a745a051718f7e0002c602b18d0bff9a4a40c4325432016f0dbb3d1164
|
File details
Details for the file rusty_todo_md-1.10.2-py3-none-musllinux_1_2_armv7l.whl.
File metadata
- Download URL: rusty_todo_md-1.10.2-py3-none-musllinux_1_2_armv7l.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3, musllinux: musl 1.2+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6be244d8ed8f40f5585c2ab93c24f0f0d6bd939779b5337442a3b48d448eeea
|
|
| MD5 |
a20972bd5ec0a1d70c7079f70a908ebf
|
|
| BLAKE2b-256 |
2162542ae728223e95f7c214471952d29731511eb07f5e606fb7e96e9731026a
|
File details
Details for the file rusty_todo_md-1.10.2-py3-none-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: rusty_todo_md-1.10.2-py3-none-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36bfd45d3984fd5cbe7962906fd66eed62eee6b57f2d6e5f4b41cb7e8d809c7a
|
|
| MD5 |
2ddee0530f4b59c7c52f3808899252bd
|
|
| BLAKE2b-256 |
0ce14616eb3b406899ae1cf3d080f933f27caa6843d1ded844221eeb54e3f5db
|
File details
Details for the file rusty_todo_md-1.10.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: rusty_todo_md-1.10.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
882793aec04b9a0dc6936d4bab8c0966f54fe1232999604b991ba7cfd948fd61
|
|
| MD5 |
ed41957ed78925bbd2dbba89f51fa407
|
|
| BLAKE2b-256 |
9bd17f859393f9c2c57acf8258596a34b8d7fd4849ba3208a7b7b881e13175bd
|
File details
Details for the file rusty_todo_md-1.10.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.
File metadata
- Download URL: rusty_todo_md-1.10.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 2.0 MB
- Tags: Python 3, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47161a0d9e620b251fbec0de8e959aedcfb75bdb0c2ff1c1a80d3d0ad74de4d2
|
|
| MD5 |
a6bf6db5048486aca6b37a614811cd3c
|
|
| BLAKE2b-256 |
891081a34310593de9a3a762b0b770fa2a296cb7624e1f9aee741d5f20b73d69
|
File details
Details for the file rusty_todo_md-1.10.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: rusty_todo_md-1.10.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b41d8e78d2c6b0128172aa9b75658c58cd1d3d2d22184d193a41aff5fd15282
|
|
| MD5 |
6c10bd3767f5c08390ca9eceaddc41b4
|
|
| BLAKE2b-256 |
0d4af29853785196be806d33864745b3c0b605b24c67949100240b8ef27226ed
|
File details
Details for the file rusty_todo_md-1.10.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: rusty_todo_md-1.10.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d61f0c108baa08c1d952020e7c194bcbd40628f6837305d5f7b763e8890f06f2
|
|
| MD5 |
fd8a5539347304622588132ef64ca0b5
|
|
| BLAKE2b-256 |
3569115404fff53878eca76bb716ed45fbbe7838a824e2766ab6647f4f8282c0
|
File details
Details for the file rusty_todo_md-1.10.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: rusty_todo_md-1.10.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84ba2ccdac8632d5739980970ff34a0e770a10d0822af2f42e17e915e850aea5
|
|
| MD5 |
6199038451407e6906dd4769498bbde8
|
|
| BLAKE2b-256 |
15fe4b835d7c1882cac7b0c97c5f91734c67f73fef288af6fce6cc0cd8fe9b73
|
File details
Details for the file rusty_todo_md-1.10.2-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: rusty_todo_md-1.10.2-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27c9431a9171ad419235911ac94d4fe38d156a6b0a9cac44f40ed3055bed3820
|
|
| MD5 |
7bc3e8bd4525aa5e443d1fec9e9de74f
|
|
| BLAKE2b-256 |
a7ded37b79c484e946cd544175b7f14b432b17aa5b4e4561df5d345fa271a9f2
|
File details
Details for the file rusty_todo_md-1.10.2-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: rusty_todo_md-1.10.2-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b408fcac897c6c63a894e1ccfb52cbc4303282cb62c5c69c7c24ba596cd87534
|
|
| MD5 |
fb7ec3a0acbef6696a9f6125db1e92d3
|
|
| BLAKE2b-256 |
d90b960227400f847566081b613848a3db9007019ea74cec0e406812dad50e1c
|