mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 22:21:22 -07:00
refactor(core): Clean up exclude description (#11678)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -115,11 +115,4 @@ export class FileDiscoveryService {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns loaded patterns from .geminiignore
|
||||
*/
|
||||
getGeminiIgnorePatterns(): string[] {
|
||||
return this.geminiIgnoreFilter?.getPatterns() ?? [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,19 +133,12 @@ ${this.config.getTargetDir()}
|
||||
// Determine the final list of exclusion patterns exactly as in execute method
|
||||
const paramExcludes = this.params.exclude || [];
|
||||
const paramUseDefaultExcludes = this.params.useDefaultExcludes !== false;
|
||||
const geminiIgnorePatterns = this.config
|
||||
.getFileService()
|
||||
.getGeminiIgnorePatterns();
|
||||
const finalExclusionPatternsForDescription: string[] =
|
||||
paramUseDefaultExcludes
|
||||
? [
|
||||
...getDefaultExcludes(this.config),
|
||||
...paramExcludes,
|
||||
...geminiIgnorePatterns,
|
||||
]
|
||||
: [...paramExcludes, ...geminiIgnorePatterns];
|
||||
? [...getDefaultExcludes(this.config), ...paramExcludes]
|
||||
: [...paramExcludes];
|
||||
|
||||
let excludeDesc = `Excluding: ${
|
||||
const excludeDesc = `Excluding: ${
|
||||
finalExclusionPatternsForDescription.length > 0
|
||||
? `patterns like
|
||||
${finalExclusionPatternsForDescription
|
||||
@@ -156,16 +149,6 @@ ${finalExclusionPatternsForDescription
|
||||
: 'none specified'
|
||||
}`;
|
||||
|
||||
// Add a note if .geminiignore patterns contributed to the final list of exclusions
|
||||
if (geminiIgnorePatterns.length > 0) {
|
||||
const geminiPatternsInEffect = geminiIgnorePatterns.filter((p) =>
|
||||
finalExclusionPatternsForDescription.includes(p),
|
||||
).length;
|
||||
if (geminiPatternsInEffect > 0) {
|
||||
excludeDesc += ` (includes ${geminiPatternsInEffect} from .geminiignore)`;
|
||||
}
|
||||
}
|
||||
|
||||
return `Will attempt to read and concatenate files ${pathDesc}. ${excludeDesc}. File encoding: ${DEFAULT_ENCODING}. Separator: "${DEFAULT_OUTPUT_SEPARATOR_FORMAT.replace(
|
||||
'{filePath}',
|
||||
'path/to/file.ext',
|
||||
|
||||
Reference in New Issue
Block a user