Commit 3adc971
authored
* fix(config): honor include/exclude globs in file collection (#981)
config.include and config.exclude were declared in DEFAULTS but never
consumed by either engine, so users' glob filters in .codegraphrc.json
had no effect. Both engines now compile the globs once and filter
collected paths (relative to project root, forward-slash normalized)
during initial walks and incremental fast-path rebuilds.
- New src/shared/globs.ts with compileGlobs + matchesAny (extracted
from features/boundaries.ts so the collector and boundaries share
one implementation)
- TS collector: passesIncludeExclude applied in collectFiles recursion
and tryFastCollect so config changes take effect on incremental builds
- Rust collector: globset-based filter wired through collect_files and
try_fast_collect; BuildConfig gains include/exclude fields
- Integration tests (wasm + native parity) cover exclude reject, include
limit, combined filters, and empty-config default behavior
Fixes #981
Impact: 19 functions changed, 20 affected
* chore: sync Cargo.lock for globset dependency (#981)
* fix(globs): enforce path-component boundary for `**/<literal>` patterns (#994)
The `globToRegex` WASM-side glob compiler consumed the `/` after `**`
without adding a directory-boundary group, so `**/index.ts` compiled to
`^.*index\.ts$` and matched `barindex.ts`. The Rust `globset` crate
enforces the boundary, so the two engines disagreed on these patterns.
Compile `**/` as `(?:[^/]+/)*` — zero or more complete directory
segments — keeping parity with globset. Bare `**` (e.g. trailing in
`dir/**`) still compiles to `.*` so `dir/**` keeps matching `dir/a/b`.
Adds regression tests for `**/<literal>` and `dir/**`.
Impact: 1 functions changed, 8 affected
* fix(config): surface GlobSetBuilder::build errors instead of silently disabling filters (#994)
If `GlobSetBuilder::build()` returned `Err`, `build_glob_set` silently
returned `None` and all include/exclude filters were disabled — users
would see unexpected files in the graph with no clue why. Mirror the
per-pattern error path and log the failure via `eprintln!` before
falling back to `None`.
Impact: 1 functions changed, 8 affected
1 parent fb82f5b commit 3adc971
11 files changed
Lines changed: 567 additions & 40 deletions
File tree
- crates/codegraph-core
- src
- src
- domain/graph/builder
- stages
- features
- tests
- integration
- unit
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
| 552 | + | |
| 553 | + | |
552 | 554 | | |
553 | 555 | | |
554 | | - | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
555 | 562 | | |
556 | 563 | | |
557 | | - | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
558 | 570 | | |
559 | 571 | | |
560 | | - | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
561 | 578 | | |
562 | 579 | | |
563 | 580 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
13 | 24 | | |
14 | 25 | | |
15 | 26 | | |
| |||
129 | 140 | | |
130 | 141 | | |
131 | 142 | | |
| 143 | + | |
| 144 | + | |
132 | 145 | | |
133 | 146 | | |
134 | 147 | | |
135 | 148 | | |
136 | 149 | | |
137 | 150 | | |
| 151 | + | |
| 152 | + | |
138 | 153 | | |
139 | 154 | | |
140 | 155 | | |
| |||
145 | 160 | | |
146 | 161 | | |
147 | 162 | | |
| 163 | + | |
| 164 | + | |
148 | 165 | | |
149 | 166 | | |
150 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
44 | 45 | | |
45 | 46 | | |
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 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
47 | 108 | | |
48 | 109 | | |
49 | 110 | | |
50 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
51 | 119 | | |
52 | 120 | | |
53 | 121 | | |
| |||
58 | 126 | | |
59 | 127 | | |
60 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
61 | 133 | | |
62 | 134 | | |
63 | 135 | | |
| |||
105 | 177 | | |
106 | 178 | | |
107 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
108 | 193 | | |
109 | 194 | | |
110 | 195 | | |
| |||
117 | 202 | | |
118 | 203 | | |
119 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
120 | 209 | | |
121 | 210 | | |
122 | 211 | | |
123 | 212 | | |
124 | 213 | | |
125 | 214 | | |
| 215 | + | |
| 216 | + | |
126 | 217 | | |
127 | 218 | | |
128 | 219 | | |
| |||
134 | 225 | | |
135 | 226 | | |
136 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
137 | 232 | | |
138 | 233 | | |
139 | 234 | | |
140 | 235 | | |
141 | 236 | | |
142 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
143 | 244 | | |
144 | 245 | | |
145 | 246 | | |
| |||
171 | 272 | | |
172 | 273 | | |
173 | 274 | | |
174 | | - | |
| 275 | + | |
175 | 276 | | |
176 | 277 | | |
177 | 278 | | |
| |||
200 | 301 | | |
201 | 302 | | |
202 | 303 | | |
203 | | - | |
| 304 | + | |
204 | 305 | | |
205 | 306 | | |
206 | 307 | | |
207 | 308 | | |
208 | 309 | | |
209 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
210 | 359 | | |
211 | 360 | | |
212 | 361 | | |
| |||
218 | 367 | | |
219 | 368 | | |
220 | 369 | | |
221 | | - | |
| 370 | + | |
222 | 371 | | |
223 | 372 | | |
224 | 373 | | |
| |||
230 | 379 | | |
231 | 380 | | |
232 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
233 | 406 | | |
0 commit comments