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.

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

  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

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-dir flag 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, 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.10.0.tar.gz (100.1 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.10.0-py3-none-win_amd64.whl (1.8 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3Windows x86

rusty_todo_md-1.10.0-py3-none-musllinux_1_2_x86_64.whl (1.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

rusty_todo_md-1.10.0-py3-none-musllinux_1_2_i686.whl (1.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

rusty_todo_md-1.10.0-py3-none-musllinux_1_2_armv7l.whl (1.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARMv7l

rusty_todo_md-1.10.0-py3-none-musllinux_1_2_aarch64.whl (1.8 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

rusty_todo_md-1.10.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

rusty_todo_md-1.10.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

rusty_todo_md-1.10.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (1.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

rusty_todo_md-1.10.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

rusty_todo_md-1.10.0-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.10.0-py3-none-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

rusty_todo_md-1.10.0-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.10.0.tar.gz.

File metadata

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

File hashes

Hashes for rusty_todo_md-1.10.0.tar.gz
Algorithm Hash digest
SHA256 5f8f1de852610b07a59e5ca7d1f72a7985cc0b5cdb4552bfd252919672a085ef
MD5 c94cbcfd4fc968d620fa4a0ac38f6af3
BLAKE2b-256 ce49df839e0090dd608012c734993314d6deca1a5e6208ec3f4ddc1defb8d6c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b59b52375f1cd4f748f881059315426f76131559510c0c030432f1b638e9a123
MD5 40285b1b8a5f590913527d403846561d
BLAKE2b-256 53da7a0e0ed942d364209480c9735229b34821675e602fd59e3e81f7b51b167e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 59989f687339f9b1b8ed10d425c8f6118e7ee935bd9fc5fd73572f966592bcde
MD5 bef5a9068845789272f19d29f2245d79
BLAKE2b-256 bb498a681940182308a2cf80a5ca9ac380d537a638c0dd07c5571ecfdad44bb4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 42aa24d8779f312f58f3d08ba93a7ea2b023a38ab5198b89f5d18da7699495e1
MD5 1ee9010778b02be13ced971b3959231a
BLAKE2b-256 e2fef216593a4f3a70ecbe0f3c87a5054b2bc350ceb8d44427624790688cc251

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.0-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 87b5c7d70f3b7b6c1b330da7e1e1029c588933893498088ba5652a52a2d6e5f3
MD5 944417398715e33860c5358f2b012223
BLAKE2b-256 e94c2c22cf556dfb09ce8b77c1029ab59768280159d2c801a0a67a145d017fce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.0-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 15479aa76e1c263f8c2273d0b21b0a6a1a961933a6786d4f9b9d22e460ff9fc4
MD5 0b2f4272c69f1237f18eff4fbf10f126
BLAKE2b-256 b15238ff97f395136f1361de32013f5a94af47fa980ffad4fade5d493d4cbdd3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 ad99bca7ff5572a32ed226fea4140e16cdb294b0b14c109350eba8a9f1c2f326
MD5 18a8f44efdd08733ffb2cdddd45c68e8
BLAKE2b-256 802ab96b181a4b6e4877e87cfc2607b7a33c00ede12dfc2e3c8051f849cf4ad0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b6d2d2197f39841ffaf0382bb48e80374dd944f5453719844a80b31cbc5d869c
MD5 711f7d536a43a041558c92822f39465e
BLAKE2b-256 cf1492370651c567e2543ad279616e247214527a83a6811373450c26827b8b0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 9722a251fa209e0c4d9268cf224db254f8993c7afbb548daaf80ed3efb2586c1
MD5 49afb147c906ae78fc1cc4b02acc035e
BLAKE2b-256 6e7c53ae1509f554222d1e22a64fe190f920a99af3f6005650d4472a97a4d51f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 6bfee52827a9dce8580e3c4693c5951b729807ed7e21d6d0cbf2a2099114e960
MD5 b1d9a2d2c94faf4f55b96c3afc1c12c9
BLAKE2b-256 7897bd23e1c97bd69fec30e80bbb2252877d17177458b1ed651755fed4dc84b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 b94a7fe013de5e58eef96aabe368b4d24398f984e5240d1ac532df3a06334e68
MD5 8289749f2543d760121dcc0adbb39d3a
BLAKE2b-256 d662f90e006394d7653438c5d060623e4a64676b662b458361a0ed472828c6c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 44d584b5e158697a9d53874bc6b63bae6e006b2c1bdce5c55f0cd1f92a273b6d
MD5 7e750b32039d7b1f658b8c57e974e147
BLAKE2b-256 f8a5c11026fa1a62306df89b1c716a277e7914751bdef2a9457db72607b3852f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 08b54447cee9df2c64ce5d4b0393a198f890bc588000e65e8045aab95cbe0e2a
MD5 2ee57fa9e004152c81fe389b2adecb98
BLAKE2b-256 42fb52e525e6762878d7667093207cb0f6dbb6cf09b203b8100a2e9c016506c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9d20e776e7a383c0e9e7a859888eac398c1303a0a25293bb9404e8ae3bc0e7de
MD5 3fb78ae5abf297e39411ee8a13325f21
BLAKE2b-256 d3f78fcfcc0d0e425fbf3ecc01af8a0324e807c8f4a140cb06fdf958885461fa

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