Update prek skills to warn against directory-scoped files patterns#1839
Merged
Conversation
Update usethis-prek-hook-bespoke-create (v1.2 → v1.3) and usethis-prek-add-hook (v1.4 → v1.5) to explicitly warn against using directory-scoped `files` patterns when configuring prek hooks. Resolves #1838 Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/82e3d1c4-6873-4c27-8d11-a07195120215 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix agent to never scope prek hooks to specific directories
Update prek skills to warn against directory-scoped Apr 7, 2026
files patterns
nathanjmcdougall
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agents were configuring prek hooks with
files: ^(src|tests)/instead of usingtypesfilters orpass_filenames, silently missing violations outside those directories.Changes
usethis-prek-add-hook(v1.4 → v1.5): New "File targeting" section with the directive to usetypes: [python]orpass_filenames: falseinstead of directory-scopedfilespatterns. Documents the narrow exception forpygrephooks where the pattern is only a violation in a specific directory.usethis-prek-hook-bespoke-create(v1.2 → v1.3): Added warning in the "Wiring into.pre-commit-config.yaml" key points againstfiles-based directory scoping.Principle