* Validate the `include` patterns: an array of non-empty gitignore-style strings * naming first-party source to force INTO the index despite `.gitignore` — the * whitelist for SVN/Perforce-only source a project gitignores out of Git (the * general case `includeIgnored` never covered). A non-array
(parsed: object, file: string)
| 335 | * project-root-relative paths. |
| 336 | */ |
| 337 | function extractInclude(parsed: object, file: string): string[] { |
| 338 | const raw = (parsed as ProjectConfig).include; |
| 339 | if (raw === undefined) return []; |
| 340 | if (!Array.isArray(raw)) { |
| 341 | logWarn(`Ignoring "include" in ${PROJECT_CONFIG_FILENAME}: must be an array of gitignore-style patterns`, { file }); |
| 342 | return []; |
| 343 | } |
| 344 | |
| 345 | const out: string[] = []; |
| 346 | for (const entry of raw) { |
| 347 | if (typeof entry !== 'string' || !entry.trim()) { |
| 348 | logWarn(`Ignoring an "include" entry in ${PROJECT_CONFIG_FILENAME}: every pattern must be a non-empty string`, { file }); |
| 349 | continue; |
| 350 | } |
| 351 | out.push(entry.trim()); |
| 352 | } |
| 353 | return out; |
| 354 | } |
| 355 | |
| 356 | /** |
| 357 | * Load the parsed `codegraph.json` for a project, mtime-cached. A missing or |
no test coverage detected