Skip to content

Implement autofix for the doc sync hook#1727

Merged
nathanjmcdougall merged 3 commits intomainfrom
copilot/implement-autofix-doc-sync-hook
Apr 1, 2026
Merged

Implement autofix for the doc sync hook#1727
nathanjmcdougall merged 3 commits intomainfrom
copilot/implement-autofix-doc-sync-hook

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

Replace the check-only check-doc-sync hook with fix-doc-sync that auto-updates sync blocks in markdown files to match their source .txt files. Runs at priority 1 (same group as ruff-format), after the export hooks at priority 0 that generate the source files.

  • hooks/fix-doc-sync.py — New autofix hook. Finds <!-- sync:path --> blocks, reads the referenced source file, and rewrites the block content in-place. Preserves fenced code block wrappers. Returns exit 1 when files are modified (pre-commit convention).
  • hooks/check-doc-sync.py — Removed, superseded by the autofix.
  • .pre-commit-config.yaml — Replaced check-doc-sync (priority 0) with fix-doc-sync in its own repo: local block at priority 1.
  • Skill files — Updated check-doc-sync references to fix-doc-sync.

Copilot AI and others added 2 commits April 1, 2026 12:12
Replace the check-only check-doc-sync hook with a new fix-doc-sync hook
that automatically updates sync blocks in markdown files to match their
source files. The hook detects and preserves code block wrappers.

The fix-doc-sync hook runs at priority 1 (same group as ruff-format),
after the export hooks at priority 0 that generate the source .txt files.

Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/e21a4040-f951-4ef9-af85-836c1e614916

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/e21a4040-f951-4ef9-af85-836c1e614916

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement autofix for the doc sync hook Implement autofix for the doc sync hook Apr 1, 2026
Copilot AI requested a review from nathanjmcdougall April 1, 2026 12:18
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 1, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing copilot/implement-autofix-doc-sync-hook (521539e) with main (c08fe12)

Open in CodSpeed

@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review April 1, 2026 12:45
@nathanjmcdougall nathanjmcdougall merged commit 3cf5534 into main Apr 1, 2026
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the copilot/implement-autofix-doc-sync-hook branch April 1, 2026 12:46
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.

Implement an autofix for the doc sync hook

2 participants