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.1.tar.gz (99.9 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.1-py3-none-win_amd64.whl (1.8 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3Windows x86

rusty_todo_md-1.10.1-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.1-py3-none-musllinux_1_2_i686.whl (1.9 MB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

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

Uploaded Python 3musllinux: musl 1.2+ ARMv7l

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

rusty_todo_md-1.10.1-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.1-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.10.1-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.10.1-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.1-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.1-py3-none-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

rusty_todo_md-1.10.1-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.1.tar.gz.

File metadata

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

File hashes

Hashes for rusty_todo_md-1.10.1.tar.gz
Algorithm Hash digest
SHA256 25b2a83dae12640de061be189bb72d320156b18b9df369fe5f4a1215cedf0330
MD5 ec2ed84fdef2578153a7d47e67df4e66
BLAKE2b-256 381edbcac32d5fa450ebdef331b63c3e95532f4289b61f70455f2c6ad35393a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 5ac0f6f02ae1608248c3fe17a2289b40f1004426bd01e5b9afeb15f54fd6e56f
MD5 1a8110dcfb8d0ca70fb382f782f83419
BLAKE2b-256 92ec1d891ea4e459d49d7af4cd7138b06d834f79b11e5826aa9899e355e36c24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 88faad400087a5c2a11aa75637fd8bbeb5e87ad30520d544fdf76e56fa3c9d42
MD5 c109411eaf73e5e4332048e41692bd93
BLAKE2b-256 2670bc244c68c684f1f143a1a984375821e96dce805e2d276f5e0d63944f2abd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.1-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 171625f4f0abce0394c6f97b3535d379a707ea024e494f1ca61190997b3ee8bf
MD5 29067a02c5efd147548134901789c7b2
BLAKE2b-256 347130c55a974e661f4ad410a7adbaf7da9710bf25528e054716e85ff08b01bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.1-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 e2c32494f5685421782faacbb5088bf218a206a30281fc375cb7bae52dbf04a8
MD5 a8e6d48c48870d60c57dc10fa55d0029
BLAKE2b-256 e0837e612c6d1d68d40a1f1318b2d70c7bb1231b992e6d56d699e7d8322ec8e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.1-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 9f8b73066216a539afa5f30348bd6e979fd8c2984eeb23c369a620e8f8116f2f
MD5 b6b4e0bf24573ac4f8bfe21474d5badf
BLAKE2b-256 24b0a8f402c5ca1a56e9463bb1390a8d76bfc42cb63814bcefe8f80975b2574e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.1-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 08102a0c4af1bacc892503080c025d1ede5853a0b4df30a3fc724ea683d6d866
MD5 0085d613523430108aae9a20d9ae573a
BLAKE2b-256 e3fce63d0797098f255e33f6916f63aa78b800a7c4f987aa88e24db4d706f8e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6089409d926c748a46f588d91f8c9507af789c54a809b271d9b18d8951676458
MD5 a91a6e4f619c1dcb58046e202dda7801
BLAKE2b-256 e36cc0a851f7fe7722bce3269a3563671c2347f4b559b0f82af4a685ca01c898

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 044241093deae58bea8a3477df18cb90ee3d32cd7a6ed9ee5b3cfd7a138aba40
MD5 6765308ae51304e213cfde02129fbb2f
BLAKE2b-256 6bd1aa1517d15364644b6bef1c5416534e107b0bca14117bc6c770f1d1254e59

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 41bac8d7a5b0c2b8f41c70b830cae721ec7b2e66e9939f4b9f1f65005af361b4
MD5 0bfa9d8ab6a8868afdc21373e63a46af
BLAKE2b-256 9321fd864dfa36fe77668da1a0fcb45338f4494261e4c139fb126b1a21c08877

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 0be785d77c908144c46055d034c1f28404d7dc3f049ffb9ac06ff1a4d3e0fbe2
MD5 a263e42a8466d02e364975e918da56a4
BLAKE2b-256 3cd19312363963627b40fcfe481649fa9e632178722e7f47ae239da01f6b8d62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8f37bfa0873fb9e70b7b2cc0a55bdcbfa619836d887b70e70f6614624d5fb3fb
MD5 5b12cb70b5278153d5eeeec8164884ff
BLAKE2b-256 61cd16ac898389287c4668f8be93b9f1385efad88ba15bacb0d18c7de6d6fe8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 21d3d88acc053d18a91843c127c0fd084ff0fb98769d8c30fef446de34657e09
MD5 443e6ad8d2fbf1c202c1013caa2b8d9e
BLAKE2b-256 63c2275678f2bccb1d4c92e2a0a6b6b3a1b8f604c1b9b371b4ffdee883d8ddfa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rusty_todo_md-1.10.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 10b47f3a396450d9d2eec90849665b10e887e6c39f49e77e9afb463c2604ce7c
MD5 dc1a58e4efa12eb09dbe103def03d2eb
BLAKE2b-256 e01357608c9a46dc545f8b3471f851569623d89b4532ca348d5d8198abbc0842

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