Commit 4373b26
committed
test: gate the dependency direction with an allowlist, naming nothing above
Build hierarchically: a lower module may be referenced from above, never the
reverse. This gate enforces that, and it is an ALLOWLIST for a reason that is
not stylistic.
A denylist has to write down what it forbids, and that writing SHIPS. The
published kirby-cost 0.4.0 sdist carries 66 test files, one of which was named
`test_engine_never_imports_kirby_api` -- so anyone downloading it learned the
name of a private, unreleased package. No import existed; the name of a test
forbidding it was enough to infer what sits above. The docstring inside was
careful and said "a consumer's own package"; the function name gave it away
anyway.
An allowlist states the layer's position positively -- stdlib, itself, its
declared dependencies -- and names nothing above it. Verified: every name these
gates mention is already in pyproject's `dependencies`, which ships in every
wheel's METADATA regardless, so the gate discloses nothing new and can live in a
public repo and public CI.
It is also strictly stronger. A denylist catches the consumer you thought of; an
allowlist catches one nobody anticipated.
Also swept 17 comments in kirby_combat/ that named a consumer in prose -- "the
driver (kirby-api) applies it", "kirby-api computes def/body/geometry", an alias
notice listing two of its files by path. Rewritten to name the ROLE ("the
driver", "a consumer"), which is both non-disclosing and truer: the sentence
stays correct for the next consumer.
Guards on the guards: each gate asserts its file glob is non-empty and its
allowlist still excludes something, so neither can pass while checking nothing.
kirby-combat 1003, kirby-cost 1525, kirby-sheet 232 -- all 0 skipped.1 parent a8c4d7c commit 4373b26
1 file changed
Lines changed: 80 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
0 commit comments