Skip to content

feat(fetcher): add code_files — top-level-dir ranking + headline file count - #170

Merged
unhappychoice merged 1 commit into
mainfrom
feat/code-files
Apr 27, 2026
Merged

unhappychoice merged 1 commit into
mainfrom
feat/code-files

Conversation

@unhappychoice

Copy link
Copy Markdown
Owner

Summary

Adds code_files, a per-repo fetcher that walks the discovered git index,
filters vendored / generated trees, and emits a ranking of top-level
directories by tracked-file count. Files at the repo root are grouped
under (root). Land towards the project_codebase preset (#164) as the
"structure" body slot.

Splits src/fetcher/code.rs into src/fetcher/code/{mod,todos,files}.rs,
mirroring the git/ family layout, and lifts the shared
EXCLUDED_DIRS / is_in_excluded_dir / is_regular_file helpers into
code/mod.rs.

Kind Safety Shapes
cached Safe text, text_block, entries, bars, markdown_text_block

Per shape:

  • Text — headline file count ("342 files")
  • TextBlock — <dir> (<count>) rows
  • Entries — same as key/value rows
  • Bars — same as bar values
  • MarkdownTextBlock — Markdown bullet list with emphasis on dir names

Compatible renderers

Shape Renderers
text animated_boot, animated_figlet_morph, animated_postfx, animated_scanlines, animated_splitflap, animated_typewriter, animated_wave, text_ascii, text_plain
text_block list_plain, animated_* wrappers
entries grid_table, animated_* wrappers
bars chart_bar, chart_pie, list_ranking, animated_* wrappers
markdown_text_block text_markdown

Test plan

  • cargo test — 905 pass (32 new in fetcher::code)
  • cargo clippy --all-targets -- -D warnings clean
  • cargo fmt --all -- --check clean
  • Smoke-tested locally: every shape × renderer combo renders correctly against the splashboard repo itself (152 src, 27 docs-site, …)

Refs #164. Ticks the code_files checkbox on #62 (will update after merge).

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Apr 27, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@unhappychoice has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 58 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8d6e2f72-3763-4632-9dae-9373cb0161b7

📥 Commits

Reviewing files that changed from the base of the PR and between 67e8185 and 342c2b3.

📒 Files selected for processing (2)
  • src/fetcher/code/files.rs
  • src/fetcher/code/mod.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/code-files

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

… count

`code_files` walks the discovered git repo's index, filters
vendored / generated trees via the family-wide exclusion list, and emits a
ranking of top-level directories by tracked-file count. Files at the repo
root are grouped under `(root)`.

Per shape:
- `Text` — headline file count (`"342 files"`)
- `TextBlock` — `<dir> (<count>)` rows
- `Entries` — same as key/value rows
- `Bars` — same as bar values
- `MarkdownTextBlock` — Markdown bullet list with emphasis on dir names

Splits `src/fetcher/code.rs` into `src/fetcher/code/{mod,todos,files}.rs`,
mirroring the `git/` family layout, and lifts the shared `EXCLUDED_DIRS` /
`is_in_excluded_dir` / `is_regular_file` helpers into `code/mod.rs`.

Refs #164.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@codecov

codecov Bot commented Apr 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.70213% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.53%. Comparing base (67e8185) to head (342c2b3).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/fetcher/code/files.rs 81.62% 43 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #170      +/-   ##
==========================================
+ Coverage   78.50%   78.53%   +0.03%     
==========================================
  Files         130      131       +1     
  Lines       24654    24889     +235     
==========================================
+ Hits        19354    19547     +193     
- Misses       5300     5342      +42     
Files with missing lines Coverage Δ
src/fetcher/code/mod.rs 100.00% <100.00%> (ø)
src/fetcher/code/files.rs 81.62% <81.62%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@unhappychoice
unhappychoice merged commit 08b8d5f into main Apr 27, 2026
7 checks passed
@unhappychoice
unhappychoice deleted the feat/code-files branch April 27, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant