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

Function extractIncludeIgnored

src/project-config.ts:194–211  ·  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

192 * `.gitignore` line would.
193 */
194function extractIncludeIgnored(parsed: object, file: string): string[] {
195 const raw = (parsed as ProjectConfig).includeIgnored;
196 if (raw === undefined) return [];
197 if (!Array.isArray(raw)) {
198 logWarn(`Ignoring "includeIgnored" in ${PROJECT_CONFIG_FILENAME}: must be an array of gitignore-style patterns`, { file });
199 return [];
200 }
201
202 const out: string[] = [];
203 for (const entry of raw) {
204 if (typeof entry !== 'string' || !entry.trim()) {
205 logWarn(`Ignoring an "includeIgnored" entry in ${PROJECT_CONFIG_FILENAME}: every pattern must be a non-empty string`, { file });
206 continue;
207 }
208 out.push(entry.trim());
209 }
210 return out;
211}
212
213/**
214 * Validate the `exclude` patterns: an array of non-empty gitignore-style

Callers 1

parseConfigFunction · 0.85

Calls 1

logWarnFunction · 0.90

Tested by

no test coverage detected