Commit e05ea39
* Replace DotNet.Glob with Microsoft.Extensions.FileSystemGlobbing
Fixes #201. DotNet.Glob v2.1.1 throws IndexOutOfRangeException on **
patterns (e.g. **/samples/**). Replace it with
Microsoft.Extensions.FileSystemGlobbing in all three call sites:
- DetectorProcessingService: directory exclusion via --DirectoryExclusionList
- YarnLockComponentDetector: workspace pattern matching
- RustSbomDetector: Cargo workspace include/exclude rules
FileSystemGlobbing's ** does not match zero trailing segments, so
**/dir/** patterns get a companion **/dir pattern added in the
directory exclusion predicate.
Paths are normalized to forward slashes before matching, which replaces
the DotNet.Glob-specific backslash escaping workaround.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR review feedback
- Respect allowWindowsPaths flag: skip patterns containing backslashes
when the flag is false, restoring the original behavior where
backslash-based patterns don't match on non-Windows platforms
- Remove unused rootPath variable in YarnLockComponentDetector
- Fix stale XML doc on AddGlobRule (was claiming OS-dependent case
sensitivity, but the code always uses OrdinalIgnoreCase)
- Add test for trailing ** companion pattern workaround
- Fix absolute path handling in directory exclusion predicate by
stripping the root prefix before matching
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 97f3d73 commit e05ea39
7 files changed
Lines changed: 98 additions & 57 deletions
File tree
- src
- Microsoft.ComponentDetection.Detectors
- rust
- yarn
- Microsoft.ComponentDetection.Orchestrator
- Services
- test/Microsoft.ComponentDetection.Orchestrator.Tests/Services
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
Lines changed: 15 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
411 | | - | |
412 | | - | |
413 | | - | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
422 | | - | |
| 421 | + | |
| 422 | + | |
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | | - | |
| 444 | + | |
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
| 453 | + | |
462 | 454 | | |
463 | 455 | | |
464 | 456 | | |
465 | | - | |
| 457 | + | |
466 | 458 | | |
467 | 459 | | |
468 | | - | |
| 460 | + | |
469 | 461 | | |
470 | 462 | | |
471 | 463 | | |
472 | | - | |
| 464 | + | |
473 | 465 | | |
474 | 466 | | |
475 | 467 | | |
476 | 468 | | |
477 | 469 | | |
478 | 470 | | |
479 | 471 | | |
480 | | - | |
481 | | - | |
| 472 | + | |
| 473 | + | |
482 | 474 | | |
483 | 475 | | |
484 | 476 | | |
| |||
774 | 766 | | |
775 | 767 | | |
776 | 768 | | |
777 | | - | |
| 769 | + | |
778 | 770 | | |
779 | | - | |
| 771 | + | |
780 | 772 | | |
781 | 773 | | |
Lines changed: 15 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
271 | 265 | | |
272 | 266 | | |
273 | 267 | | |
274 | | - | |
| 268 | + | |
| 269 | + | |
275 | 270 | | |
276 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
277 | 280 | | |
278 | 281 | | |
279 | 282 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
Lines changed: 33 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
| 253 | + | |
253 | 254 | | |
254 | | - | |
| 255 | + | |
255 | 256 | | |
256 | | - | |
| 257 | + | |
257 | 258 | | |
258 | | - | |
259 | | - | |
260 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
261 | 262 | | |
262 | | - | |
263 | | - | |
264 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
265 | 272 | | |
266 | 273 | | |
267 | 274 | | |
268 | 275 | | |
269 | | - | |
| 276 | + | |
270 | 277 | | |
271 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
272 | 283 | | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
278 | 287 | | |
279 | | - | |
280 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
281 | 295 | | |
282 | 296 | | |
283 | 297 | | |
| |||
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
422 | 454 | | |
423 | 455 | | |
424 | 456 | | |
| |||
0 commit comments