Commit 2f321e6
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 9c0c4e0 commit 2f321e6
1 file changed
Lines changed: 38 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
100 | 122 | | |
101 | 123 | | |
102 | 124 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
106 | 128 | | |
107 | | - | |
108 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
109 | 132 | | |
110 | 133 | | |
111 | 134 | | |
| |||
0 commit comments