Skip to content

Add placement guidance to usethis-prek-add-hook skill#1507

Merged
nathanjmcdougall merged 2 commits into
mainfrom
copilot/improve-usethis-prek-add-hook-guidance
Mar 25, 2026
Merged

Add placement guidance to usethis-prek-add-hook skill#1507
nathanjmcdougall merged 2 commits into
mainfrom
copilot/improve-usethis-prek-add-hook-guidance

Conversation

Copilot AI commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

PR #1504 placed format-dedent at the top of .pre-commit-config.yaml — before config/meta hooks and far from related code formatters. Two missing placement principles in the skill allowed this.

  • New "Placement within the file" section with two principles:
    • Configuration hooks before code hooks — meta/config hooks (dependency sync, pyproject validation) precede source code hooks (formatters, linters, type checkers)
    • Similar-purpose hooks close together — new hooks go near existing hooks with the same motivation; re-order within a priority group for cosmetic proximity if needed
  • Updated procedure list — added explicit step 3: "Place the hook entry at the correct position in the file"
  • Version bump 1.11.2
Original prompt

This section details on the original issue you should resolve

<issue_title>Improve usethis-prek-add-hook placement guidance</issue_title>
<issue_description>There are two general principles being violated in #1504:

  1. Try to keep meta-programming & configuration file related hooks before code related hooks
  2. Try to add new hooks as close as possible to other hooks which are similar in purpose & motivation, e.g. two code formatters should be close together. Of course, two code formatters are likely also to cause conflicts so they may need to be separated for reasons of priority... We should re-order hooks within the same priority group to keep the cosmetic proximity with the newly added hook though, if appropriate.</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Add two placement principles:
1. Configuration hooks before code hooks
2. Similar-purpose hooks close together

Also add placement as an explicit procedure step and bump version to 1.2.

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/437beaf4-5ee2-4cef-9977-2d5b917a6315
Copilot AI changed the title [WIP] Improve usethis-prek-add-hook placement guidance Add placement guidance to usethis-prek-add-hook skill Mar 25, 2026
Copilot AI requested a review from nathanjmcdougall March 25, 2026 01:42
@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review March 25, 2026 02:00
@nathanjmcdougall nathanjmcdougall merged commit 5eef8d6 into main Mar 25, 2026
@nathanjmcdougall nathanjmcdougall deleted the copilot/improve-usethis-prek-add-hook-guidance branch March 25, 2026 02:00
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.

Improve usethis-prek-add-hook placement guidance

2 participants