mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -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;
|
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
|
// Determine the final list of exclusion patterns exactly as in execute method
|
||||||
const paramExcludes = this.params.exclude || [];
|
const paramExcludes = this.params.exclude || [];
|
||||||
const paramUseDefaultExcludes = this.params.useDefaultExcludes !== false;
|
const paramUseDefaultExcludes = this.params.useDefaultExcludes !== false;
|
||||||
const geminiIgnorePatterns = this.config
|
|
||||||
.getFileService()
|
|
||||||
.getGeminiIgnorePatterns();
|
|
||||||
const finalExclusionPatternsForDescription: string[] =
|
const finalExclusionPatternsForDescription: string[] =
|
||||||
paramUseDefaultExcludes
|
paramUseDefaultExcludes
|
||||||
? [
|
? [...getDefaultExcludes(this.config), ...paramExcludes]
|
||||||
...getDefaultExcludes(this.config),
|
: [...paramExcludes];
|
||||||
...paramExcludes,
|
|
||||||
...geminiIgnorePatterns,
|
|
||||||
]
|
|
||||||
: [...paramExcludes, ...geminiIgnorePatterns];
|
|
||||||
|
|
||||||
let excludeDesc = `Excluding: ${
|
const excludeDesc = `Excluding: ${
|
||||||
finalExclusionPatternsForDescription.length > 0
|
finalExclusionPatternsForDescription.length > 0
|
||||||
? `patterns like
|
? `patterns like
|
||||||
${finalExclusionPatternsForDescription
|
${finalExclusionPatternsForDescription
|
||||||
@@ -156,16 +149,6 @@ ${finalExclusionPatternsForDescription
|
|||||||
: 'none specified'
|
: '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(
|
return `Will attempt to read and concatenate files ${pathDesc}. ${excludeDesc}. File encoding: ${DEFAULT_ENCODING}. Separator: "${DEFAULT_OUTPUT_SEPARATOR_FORMAT.replace(
|
||||||
'{filePath}',
|
'{filePath}',
|
||||||
'path/to/file.ext',
|
'path/to/file.ext',
|
||||||
|
|||||||
Reference in New Issue
Block a user