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.
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.11argscustomise 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.11Then install the hook:
pre-commit installβ No Rust toolchain is required when using the shim and a supported platform.
You can also install Rusty TODO.md directly for manual CLI use:
pip install rusty_todo_mdThen run:
rusty-todo-md --help-
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.
rusty-todo-mdrusty-todo-md --markers TODO FIXME HACKWhen 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.rsWithout the -- separator, the files would be incorrectly treated as additional markers.
rusty-todo-md --auto-add path/to/file.rsrusty-todo-md --todo-path docs/TODOS.mdRusty TODO.md supports glob-based exclusion patterns to filter out files and directories from TODO extraction.
# 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 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"# 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"# Combine multiple exclusions
rusty-todo-md \
--exclude "*.log" \
--exclude "*.tmp" \
--exclude-dir "build" \
--exclude-dir "dist" \
--markers TODO FIXME*β 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.
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).
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
- 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) |
- 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.
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.
Contributions are welcome!
- Open an issue for bug reports or feature requests.
- Submit a pull request with improvements, new parsers, or fixes.
- Shim repo (recommended for pre-commit): rusty-todo-md-pre-commit
- PyPI package: rusty_todo_md
- Releases: GitHub Releases
Licensed under the MIT License.
If you find Rusty TODO.md helpful, please consider giving it a β on GitHub to help others discover the project.