mbudisic commited on
Commit
bbdbf24
Β·
1 Parent(s): ed8111d

doc: document TODO.md workflow and pre-commit hook in DEVELOPER.md

Browse files
Files changed (1) hide show
  1. docs/DEVELOPER.md +26 -1
docs/DEVELOPER.md CHANGED
@@ -478,4 +478,29 @@ print(title) # Prints the best available title, or None
478
 
479
  ---
480
 
481
- > "A page by any other name would still be as sweet... but it's nice to get the right one!" πŸ˜„
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
 
479
  ---
480
 
481
+ > "A page by any other name would still be as sweet... but it's nice to get the right one!" πŸ˜„
482
+
483
+ ## πŸ“ Automatic TODO Extraction
484
+
485
+ This repo uses [`flake8-todos`](https://github.com/awestlake87/flake8-todos) to collect all TODO-style comments from Python files and writes them to a `TODO.md` file at the project root.
486
+
487
+ ### How it works
488
+ - Run `uv run python scripts/generate_todo_md.py` to (re)generate `TODO.md`.
489
+ - A **manual pre-commit hook** is provided to automate this:
490
+ 1. Copy it into your git hooks:
491
+ `cp scripts/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit`
492
+ 2. On every commit, it will update `TODO.md` and stage it automatically.
493
+
494
+ ### Why manual?
495
+ - This hook is not installed by default. You must opt-in by copying it yourself (see above).
496
+ - This keeps your workflow flexible and avoids surprises for new contributors.
497
+
498
+ ### Example output
499
+ ```
500
+ # πŸ“ TODOs in Codebase
501
+
502
+ - `pstuts_rag/agent.py:42`: TD003 TODO: Refactor this function
503
+ - `scripts/generate_todo_md.py:10`: TD002 FIXME: Handle edge case
504
+ ```
505
+
506
+ Happy hacking! πŸš€