Repository navigation
feat(fetcher): add code_todos - #114
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughAdds a new Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as Caller/Dashboard
participant Fetcher as CodeTodos Fetcher
participant Cache as Cache Layer
participant Git as Git Repository
participant Scanner as File Scanner
Caller->>Cache: Check cached result (cache_key)
alt Cache Hit
Cache-->>Caller: Return cached scan data
else Cache Miss
Caller->>Fetcher: fetch(options)
Fetcher->>Git: Read repo index entries
Git-->>Fetcher: List of tracked files
Fetcher->>Scanner: Scan eligible files (respecting size cap, binary heuristic, directory exclusions)
Scanner->>Scanner: Match TODO markers (word boundary, trailing colon, TODO(name):)
Scanner-->>Fetcher: Hit count, file list, per-file hits, snippets
Fetcher->>Fetcher: Render to body shape (Text, TextBlock, Entries, or Bars)
Fetcher->>Cache: Store result with cache_key (repo_id + options_digest)
Cache-->>Caller: Return rendered body
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #114 +/- ##
==========================================
+ Coverage 77.34% 77.65% +0.31%
==========================================
Files 93 94 +1
Lines 15787 16228 +441
==========================================
+ Hits 12210 12602 +392
- Misses 3577 3626 +49
🚀 New features to boost your workflow:
|
Greps tracked source files for TODO / FIXME markers via the gix index, so .gitignore-d build artefacts and untracked scratch files are skipped automatically. Multi-shape: Text summarises totals, TextBlock lists path:line: snippet, Entries / Bars rank files by hit count. Markers and row limit configurable; bounded by file size / file count / hit caps. Ticks the project_todo_in_code box in #62. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Two widgets pointing at this fetcher with different `markers` (or `limit`) options would otherwise collide on the same cache slot, since the inherited `repo_cache_key` only mixes name / repo root / shape / format. The renderer reads the cached payload, so the second widget would silently see the first widget's marker hits. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Bare-word matching pulled in README headings, prose, and string literals
("TODO" inside `assert_eq!(label, "TODO")` etc.), inflating counts with
non-comment noise. Tighten the matcher to require `TODO:` (or the Google-
style `TODO(name):`) and reject `::` so C++ namespace paths don't match.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…ude vendored dirs `project_*` was a category mismatch — that prefix in #62 is for project-level operational state (test coverage, bundle size, dependency alerts). A TODO comment grep is a *code-internal* metric, so move it to a new `code_*` family that's the right home for future siblings (`code_loc`, `code_lint`, …). The `_in_code` suffix becomes redundant and gets dropped. Also wire an EXCLUDED_DIRS skip-list (`node_modules`, `vendor`, `third_party`, `target`, `dist`, `build`, `.git`) so committed-vendored trees that some projects ship don't bleed library TODOs into the count. `.gitignore`-d trees are still filtered out automatically by walking the index. Test_support detaches repos from the user's `core.excludesfile` so environment-level globs (commonly `node_modules` / `vendor`) don't make `git add .` skip files inside test fixtures. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
5f91649 to
bdcf1d1
Compare
Summary
TODO/FIXMEmarkers viagixindex, so.gitignore-d build artefacts and untracked files are skipped automatically — fits the per-directory killer feature angle (different repos, different unfinished work surfaced).Text("12 TODOs in 5 files"),TextBlock(path:line: snippet),Entries/Bars(files ranked by hit count).markers(default["TODO", "FIXME"]) andlimit(default 20). Bounded by 1 MB file-size cap, 5 000 file scan cap, and 500 internal hit cap so a giant repo doesn't blow up the splash.Ticks the
project_todo_in_codebox in #62.Test plan
cargo test— 528 existing + 15 new (fetcher::project) passingcargo clippy --all-targets -- -D warnings— cleancargo fmt --all -- --check— cleancargo xtaskregeneratesdocs-site/.../fetchers/project/project_todo_in_code.md(gitignored)fetcher = "project_todo_in_code"configured under./.splashboard/config.tomland confirm the four shapes render🤖 Generated with Claude Code
Summary by CodeRabbit
node_modulesandvendor, and displays results in multiple formats: summary counts, detailed file listings with line snippets, ranked hit counts, or visual bar charts.