Repo report
Profile a git repository: metrics, representative code, sample pull requests, and hygiene flags. It measures and describes — it does not score, rank, or grade.
Workflow
Confirm a local git checkout. Without git history most metrics are unavailable — say so and still run the file scan.
Run (stdlib only, no packages):
python3 scripts/repo_report.py /path/to/repo --out ./reportProduces a deliverable zip,
<repo>-report.zip, containing:File What report.pdfthe readable report, with the charts metrics.xlsx6 sheets: Summary, Timeline, Languages, Sample PRs, Sample files, Hygiene repo_report.jsoneverything, machine-readable metrics.csvone flat row report.md/report.htmlsame report, other formats chart-*.svgthe charts standalone PDF rendering uses whichever engine is installed (Chrome/Chromium/Edge headless, weasyprint, or wkhtmltopdf). If none is found it says so and writes
report.html— open and print it.--no-bundlewrites only JSON + CSV + markdown. Lower--merge-samplefor a fast pass on a very large history.Read
repo_report.json:highlights— the headline facts, ready to quote.files/history/environment— the full metric set. See references/metrics.md for how each is computed.code_excerpts— real code, ~40 lines from each of the 3 most substantive files, selected by control-flow density so the excerpt shows logic rather than boilerplate.sample_prs— up to 3 merged PRs with stats,touches_tests,references_issue, and a truncateddiff_excerpt. Ranked to show the nature of the work: issue-linked and test-touching rank highest; dependency bumps and translation churn are penalised.timeline_monthly— commits, merged PRs and distinct authors per month, the series behind the activity charts.cleanup_flags— surface these first. Secrets or PII must be removed from the working tree and git history before the repo or report is shared.
Review the code before the report leaves the machine. Excerpts are auto-redacted for secret-shaped values, but redaction is not judgement: read each excerpt and diff and confirm there is nothing private in them. Swap samples with
--excerpt-files/--sample-prs, or drop code entirely with--no-excerpts.
Honesty rules
- Report the metrics as measured; do not editorialise them into a verdict.
% Rich PRsis a lower bound — review threads live on the code host, not in git — so say so rather than implying the local number is the ceiling.- Function and class counts are regex estimates; label them as such.
- Always surface secret/PII flags. A leaked key or a customer record in a shared repo is a serious problem, and catching it first is the point.