Skip to content

feat: rebuild lessons/index.md with --check gate (#1661) - #1817

Open
zsxh1990 wants to merge 2 commits into
Ikalus1988:mainfrom
zsxh1990:feat/rebuild-lessons-index
Open

zsxh1990 wants to merge 2 commits into
Ikalus1988:mainfrom
zsxh1990:feat/rebuild-lessons-index

Conversation

@zsxh1990

Copy link
Copy Markdown
Contributor

Closes #1661.

What

  • New script scripts/rebuild_lessons_index.py regenerates lessons/index.md from lesson file frontmatter
  • --check mode: exits non-zero when index differs from generated (CI gate)
  • Deterministic: same input → byte-identical output
  • Integrated into update-lessons.yml daily job (rebuild + check before commit)

Verification

# Rebuild
python3 scripts/rebuild_lessons_index.py
# Check (should exit 0)
python3 scripts/rebuild_lessons_index.py --check
# Determinism test
python3 scripts/rebuild_lessons_index.py
git diff lessons/index.md  # should be empty

364 lessons indexed. All previously dangling/mismatched entries fixed.

Signed-off-by: Ikalus1988 Ikalus1988@users.noreply.github.com

Closes Ikalus1988#1661. Rebuild script scans lesson frontmatter and generates
deterministic index.md. --check mode exits non-zero on drift.
Integrated into update-lessons.yml daily job.

Signed-off-by: Ikalus1988 <Ikalus1988@users.noreply.github.com>
Signed-off-by: zsxh1990 <445655361@qq.com>
@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Signed-off-by: Ikalus1988 <Ikalus1988@users.noreply.github.com>
Signed-off-by: zsxh1990 <445655361@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bounty][$0][Ops] 重建 lessons/index.md 并加 --check 门禁(当前 181 条里 25 条悬空、136 条标题不符)

2 participants