Commit 3eb7150
committed
fix(scan): check user include patterns before the extension allowlist
The scan path evaluated the built-in extension allowlist before user
include globs, so an explicit include (e.g. **/*.ftl) could never force
a non-allowlisted extension into a scan — while the preview/diff path
already checks user includes first. The two paths disagreed about which
files the same include selects.
Reorders whyExcluded in scan/agent.go to match preview.go exactly:
binary, user-exclude, user-include, extension allowlist, default
excluded paths. User excludes still take precedence over includes, and
binary/size guards still run regardless. Adds a regression test: a .ftl
file with a matching include glob now yields ExcludeNone (fails on the
previous ordering).
Related to alibaba#3711 parent 2bf81bc commit 3eb7150
2 files changed
Lines changed: 16 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
352 | 358 | | |
353 | 359 | | |
354 | 360 | | |
355 | 361 | | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | 362 | | |
360 | 363 | | |
361 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
158 | 168 | | |
159 | 169 | | |
160 | 170 | | |
| |||
0 commit comments