mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-02 07:54:48 -07:00
refactor: simplify FilterReport and remove unused code (#11681)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -18,8 +18,7 @@ export interface FilterFilesOptions {
|
||||
|
||||
export interface FilterReport {
|
||||
filteredPaths: string[];
|
||||
gitIgnoredCount: number;
|
||||
geminiIgnoredCount: number;
|
||||
ignoredCount: number;
|
||||
}
|
||||
|
||||
export class FileDiscoveryService {
|
||||
@@ -70,28 +69,12 @@ export class FileDiscoveryService {
|
||||
respectGeminiIgnore: true,
|
||||
},
|
||||
): FilterReport {
|
||||
const filteredPaths: string[] = [];
|
||||
let gitIgnoredCount = 0;
|
||||
let geminiIgnoredCount = 0;
|
||||
|
||||
for (const filePath of filePaths) {
|
||||
if (opts.respectGitIgnore && this.shouldGitIgnoreFile(filePath)) {
|
||||
gitIgnoredCount++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (opts.respectGeminiIgnore && this.shouldGeminiIgnoreFile(filePath)) {
|
||||
geminiIgnoredCount++;
|
||||
continue;
|
||||
}
|
||||
|
||||
filteredPaths.push(filePath);
|
||||
}
|
||||
const filteredPaths = this.filterFiles(filePaths, opts);
|
||||
const ignoredCount = filePaths.length - filteredPaths.length;
|
||||
|
||||
return {
|
||||
filteredPaths,
|
||||
gitIgnoredCount,
|
||||
geminiIgnoredCount,
|
||||
ignoredCount,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user