mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
feat: full implementation for .geminiignore in settings and respective tool calls (#3727)
This commit is contained in:
@@ -307,6 +307,7 @@ describe('getFolderStructure gitignore', () => {
|
||||
createDirent('file1.txt', 'file'),
|
||||
createDirent('node_modules', 'dir'),
|
||||
createDirent('ignored.txt', 'file'),
|
||||
createDirent('gem_ignored.txt', 'file'),
|
||||
createDirent('.gemini', 'dir'),
|
||||
] as any;
|
||||
}
|
||||
@@ -327,6 +328,9 @@ describe('getFolderStructure gitignore', () => {
|
||||
if (path === '/test/project/.gitignore') {
|
||||
return 'ignored.txt\nnode_modules/\n.gemini/\n!/.gemini/config.yaml';
|
||||
}
|
||||
if (path === '/test/project/.geminiignore') {
|
||||
return 'gem_ignored.txt\nnode_modules/\n.gemini/\n!/.gemini/config.yaml';
|
||||
}
|
||||
return '';
|
||||
});
|
||||
|
||||
@@ -347,10 +351,37 @@ describe('getFolderStructure gitignore', () => {
|
||||
const fileService = new FileDiscoveryService('/test/project');
|
||||
const structure = await getFolderStructure('/test/project', {
|
||||
fileService,
|
||||
respectGitIgnore: false,
|
||||
fileFilteringOptions: {
|
||||
respectGeminiIgnore: false,
|
||||
respectGitIgnore: false,
|
||||
},
|
||||
});
|
||||
expect(structure).toContain('ignored.txt');
|
||||
// node_modules is still ignored by default
|
||||
expect(structure).toContain('node_modules/...');
|
||||
});
|
||||
|
||||
it('should ignore files and folders specified in .geminiignore', async () => {
|
||||
const fileService = new FileDiscoveryService('/test/project');
|
||||
const structure = await getFolderStructure('/test/project', {
|
||||
fileService,
|
||||
});
|
||||
expect(structure).not.toContain('gem_ignored.txt');
|
||||
expect(structure).toContain('node_modules/...');
|
||||
expect(structure).not.toContain('logs.json');
|
||||
});
|
||||
|
||||
it('should not ignore files if respectGeminiIgnore is false', async () => {
|
||||
const fileService = new FileDiscoveryService('/test/project');
|
||||
const structure = await getFolderStructure('/test/project', {
|
||||
fileService,
|
||||
fileFilteringOptions: {
|
||||
respectGeminiIgnore: false,
|
||||
respectGitIgnore: true, // Explicitly disable gemini ignore only
|
||||
},
|
||||
});
|
||||
expect(structure).toContain('gem_ignored.txt');
|
||||
// node_modules is still ignored by default
|
||||
expect(structure).toContain('node_modules/...');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user