MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / extractIncludeIgnored

Function extractIncludeIgnored

src/project-config.ts:260–277  ·  view source on GitHub ↗

* Validate the `includeIgnored` patterns: an array of non-empty gitignore-style * strings. A non-array value or a non-string/blank entry warns-and-skips; never * throws. Patterns are kept verbatim (trimmed) so they match exactly as a * `.gitignore` line would.

(parsed: object, file: string)

Source from the content-addressed store, hash-verified

258 * `.gitignore` line would.
259 */
260function extractIncludeIgnored(parsed: object, file: string): string[] {
261 const raw = (parsed as ProjectConfig).includeIgnored;
262 if (raw === undefined) return [];
263 if (!Array.isArray(raw)) {
264 logWarn(`Ignoring "includeIgnored" in ${PROJECT_CONFIG_FILENAME}: must be an array of gitignore-style patterns`, { file });
265 return [];
266 }
267
268 const out: string[] = [];
269 for (const entry of raw) {
270 if (typeof entry !== 'string' || !entry.trim()) {
271 logWarn(`Ignoring an "includeIgnored" entry in ${PROJECT_CONFIG_FILENAME}: every pattern must be a non-empty string`, { file });
272 continue;
273 }
274 out.push(entry.trim());
275 }
276 return out;
277}
278
279/**
280 * Validate a gitignore-style pattern list under `key`. A non-array value or a

Callers 1

parseConfigFunction · 0.85

Calls 2

logWarnFunction · 0.90
pushMethod · 0.80

Tested by

no test coverage detected