* 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)
| 288 | * project-root-relative paths. |
| 289 | */ |
| 290 | function extractInclude(parsed: object, file: string): string[] { |
| 291 | const raw = (parsed as ProjectConfig).include; |
| 292 | if (raw === undefined) return []; |
| 293 | if (!Array.isArray(raw)) { |
| 294 | logWarn(`Ignoring "include" in ${PROJECT_CONFIG_FILENAME}: must be an array of gitignore-style patterns`, { file }); |
| 295 | return []; |
| 296 | } |
| 297 | |
| 298 | const out: string[] = []; |
| 299 | for (const entry of raw) { |
| 300 | if (typeof entry !== 'string' || !entry.trim()) { |
| 301 | logWarn(`Ignoring an "include" entry in ${PROJECT_CONFIG_FILENAME}: every pattern must be a non-empty string`, { file }); |
| 302 | continue; |
| 303 | } |
| 304 | out.push(entry.trim()); |
| 305 | } |
| 306 | return out; |
| 307 | } |
| 308 | |
| 309 | /** |
| 310 | * Load the parsed `codegraph.json` for a project, mtime-cached. A missing or |
no test coverage detected