MCPcopy
hub / github.com/colbymchenry/codegraph / extractIncludeIgnored

Function extractIncludeIgnored

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

170 * `.gitignore` line would.
171 */
172function extractIncludeIgnored(parsed: object, file: string): string[] {
173 const raw = (parsed as ProjectConfig).includeIgnored;
174 if (raw === undefined) return [];
175 if (!Array.isArray(raw)) {
176 logWarn(`Ignoring "includeIgnored" in ${PROJECT_CONFIG_FILENAME}: must be an array of gitignore-style patterns`, { file });
177 return [];
178 }
179
180 const out: string[] = [];
181 for (const entry of raw) {
182 if (typeof entry !== 'string' || !entry.trim()) {
183 logWarn(`Ignoring an "includeIgnored" entry in ${PROJECT_CONFIG_FILENAME}: every pattern must be a non-empty string`, { file });
184 continue;
185 }
186 out.push(entry.trim());
187 }
188 return out;
189}
190
191/**
192 * 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