Repository navigation
Commit 09134f5
committed
ref(runtime): share the capture enumeration, not only the classifier
`loadCaptureRules` and `verify`'s loop both read `captures/`, filtered to
`.yml`/`.yaml`, sorted, parsed each file and called `assessCaptureRule`. Only
the classification was shared, so a change to what counts as a capture — a
new extension, an exclusion, the sort order — had two call sites to keep in
step, and they could drift even though the classifier could not.
`assessCaptureDirectory` is now the one enumeration both walk. Unparseable
YAML reports through the same channel rather than as a separate branch in
each caller, so there is one list of reasons a capture is refused rather than
one list plus an exception. `verify`'s "no capture rules in captures/" check
counts the same assessments instead of doing its own `readdir`.
Corrects the reason I gave for deferring this. I said the shared helper wanted
to be the one the file-set writer uses when it validates `captures/`, and that
is wrong: the writer inspects delivered paths in memory and never enumerates a
directory, so there was no second use to wait for.
Found by the review on #216.1 parent fd22d5b commit 09134f5
2 files changed
Lines changed: 57 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
9 | | - | |
| 7 | + | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
| |||
177 | 175 | | |
178 | 176 | | |
179 | 177 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
| 178 | + | |
| 179 | + | |
190 | 180 | | |
191 | 181 | | |
192 | 182 | | |
| |||
198 | 188 | | |
199 | 189 | | |
200 | 190 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
213 | 195 | | |
214 | 196 | | |
215 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
148 | 170 | | |
149 | | - | |
| 171 | + | |
150 | 172 | | |
151 | 173 | | |
152 | 174 | | |
153 | 175 | | |
154 | 176 | | |
155 | 177 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
161 | 183 | | |
162 | 184 | | |
163 | 185 | | |
164 | 186 | | |
165 | 187 | | |
166 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
167 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
168 | 208 | | |
169 | | - | |
| 209 | + | |
170 | 210 | | |
171 | 211 | | |
172 | | - | |
173 | 212 | | |
174 | 213 | | |
175 | 214 | | |
| |||
0 commit comments