Skip to content

Enforce step-down rule for hook scripts#1750

Merged
nathanjmcdougall merged 2 commits intomainfrom
copilot/refactor-hook-scripts-stepdown-rule
Apr 1, 2026
Merged

Enforce step-down rule for hook scripts#1750
nathanjmcdougall merged 2 commits intomainfrom
copilot/refactor-hook-scripts-stepdown-rule

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

Hook scripts defined helpers above main(), making readers wade through implementation details before seeing the high-level logic.

Changes

  • Skill update (usethis-prek-hook-bespoke-create v1.0 → v1.1): Added step-down rule as first bullet in "Script structure" — main() first, helpers below.
  • Refactored 6 hooks to move main() above all helper functions:
    • check-list-referenced.py
    • export-functions.py
    • export-module-tree.py
    • export-skills-directory.py
    • fix-doc-sync.py
    • fix-readme.py

Pure reordering — no logic changes.

Move main() above helper functions in all 6 hook scripts that violated the
step-down rule (check-list-referenced, export-functions, export-module-tree,
export-skills-directory, fix-doc-sync, fix-readme).

Add step-down rule guidance to the usethis-prek-hook-bespoke-create skill.

Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/6af7a970-d87b-485f-ba50-d31c096285e0

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor hook scripts to enforce step-down rule Enforce step-down rule for hook scripts Apr 1, 2026
Copilot AI requested a review from nathanjmcdougall April 1, 2026 21:22
@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review April 1, 2026 21:53
@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/refactor-hook-scripts-stepdown-rule (983ae53) with main (cb84b07)

Open in CodSpeed

@nathanjmcdougall nathanjmcdougall merged commit 8f18c22 into main Apr 1, 2026
10 checks passed
@nathanjmcdougall nathanjmcdougall deleted the copilot/refactor-hook-scripts-stepdown-rule branch April 1, 2026 22:10
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.

Agent config to encourage the stepdown rule for hooks

2 participants