Skip to content

Add auto-updating README stats (project count + Lean LOC) - #193

Merged
Vilin97 merged 1 commit into
mainfrom
vasily/readme-stats
Jun 24, 2026
Merged

Vilin97 merged 1 commit into
mainfrom
vasily/readme-stats

Conversation

@Vilin97

@Vilin97 Vilin97 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

What

Surfaces two headline numbers in the main README.md and keeps them current automatically:

  • project count — length of the projects list in LeanPool/projects.yml
  • lines of Lean — wc -l-equivalent total across LeanPool/**/*.lean (build/dependency dirs excluded)

They render in a marked block right under the intro:

<!-- BEGIN STATS -->
**90** formalization projects · **676,138** lines of Lean
<!-- END STATS -->

How

  • python/lean_pool/stats.py — computes the stats and rewrites the marked block (mirrors the existing render.py marker idiom and quality.py CLI style). Supports --check (fail-if-stale, no write) and --repo.
  • .github/workflows/readme-stats.yml — on pushes to main that touch LeanPool/**, python/lean_pool/stats.py, or the workflow itself, regenerates the block and commits it back. The refresh commit touches only README.md, which is not in the paths: filter, so it can't re-trigger itself (no commit loop). Also runnable manually via workflow_dispatch.
  • python/tests/test_stats.py — unit tests for counting, block replacement, idempotence, and --check.

Notes

  • Stats refresh only when Lean source/projects change — an empty commit won't trigger it, by design.
  • Pure tooling/infra change; touches no LeanPool/ content and no gates.

🤖 Generated with Claude Code

Adds `lean_pool.stats`, which derives the number of pooled projects
(from LeanPool/projects.yml) and total lines of Lean (from the
LeanPool/ tree) and rewrites a marked block in README.md. A new
`readme-stats.yml` workflow refreshes and commits the block on pushes
to main that touch Lean source, the stats module, or the workflow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 24, 2026 06:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Vilin97
Vilin97 merged commit 7fbbeed into main Jun 24, 2026
6 checks passed
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.

2 participants