@file don't respect config respectGitIgnore=false (#3382) (#3387)

Co-authored-by: Ryan Fang <ryan.fang@gllue.com>
This commit is contained in:
zfflxx
2025-07-07 13:48:39 +08:00
committed by GitHub
parent bb8f6b376d
commit 97d9386e3f
5 changed files with 109 additions and 33 deletions

View File

@@ -84,6 +84,24 @@ export class FileDiscoveryService {
return false;
}
/**
* Unified method to check if a file should be ignored based on filtering options
*/
shouldIgnoreFile(
filePath: string,
options: FilterFilesOptions = {},
): boolean {
const { respectGitIgnore = true, respectGeminiIgnore = true } = options;
if (respectGitIgnore && this.shouldGitIgnoreFile(filePath)) {
return true;
}
if (respectGeminiIgnore && this.shouldGeminiIgnoreFile(filePath)) {
return true;
}
return false;
}
/**
* Returns loaded patterns from .geminiignore
*/