feat: consolidate check-tests-structure hook into this repository - #5
Draft
leoschwarz wants to merge 2 commits into
Draft
feat: consolidate check-tests-structure hook into this repository#5leoschwarz wants to merge 2 commits into
leoschwarz wants to merge 2 commits into
Conversation
Vendors the check-tests-structure tool from leoschwarz/check-tests-structure into .ci/check-tests-structure/ as a self-contained MIT-licensed subproject and publishes it through a root .pre-commit-hooks.yaml, so FGCZ projects can consume the hook without depending on a personal account. The subproject keeps its own pyproject.toml and uv.lock, and is excluded from the strict Pyright, coverage, and deptry gates that apply to the reference package. The hook runs on this repository in the pre-commit stage and the subproject's tests run in the pre-push stage.
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.
check-tests-structure(tests tree must mirror sources tree) lived in a personal GitHub account, while depiction and bfabricPy depend on it. This moves the tool here and publishes it as a pre-commit hook so those projects can drop that dependency.Key changes
.ci/check-tests-structure/— the tool vendored fromleoschwarz/check-tests-structure@1228f93(incl. its unreleasedallow_missing_*fix) as a standalone subproject with its ownpyproject.toml,uv.lockand MIT license. Distribution renamed tofgcz-check-tests-structure; import package and console script names unchanged, so consumers are drop-in..pre-commit-hooks.yaml— the consumer-facing surface.pre-commitstage; the subproject's own tests run in thepre-pushstage..ci/**under a relaxed rule set, deptry excludes it, Pyright and coverage already did.Non-obvious bits
language: pythoninstalls the hook repo's root package, so a subdirectory tool normally cannot be consumed through the plainrepo:form.additional_dependencies: ["./.ci/check-tests-structure"]resolves relative to the cloned hook repo, which is what makes it work.docs/check-tests-structure.mdcarries agit+...#subdirectory=fallback for older hook environments.sources_path/tests_pathstill resolve against the working directory rather than the declaringpyproject.toml; workspace members must be checked from their own directory.rev:, so this needs a release tag after merge.Verification
Both hook stages pass; the vendored suite (12 tests) passes;
pre-commit try-repopasses on a matching tree and exits 1 with fuzzy suggestions on a missing/orphan test; thegit+...#subdirectory=form was installed and run from a git URL.Consumer repos are untouched —
docs/check-tests-structure.mdhas the pre-commit and nox snippets.🤖 Prepared with assistance from Claude Opus 5 via Claude Code.