fix: change .geminiignore to .qwenignore

This commit is contained in:
mingholy.lmh
2025-09-14 19:38:40 +08:00
parent 8bb8660c72
commit 1993156721
23 changed files with 120 additions and 118 deletions

View File

@@ -28,7 +28,7 @@ export interface LSToolParams {
ignore?: string[];
/**
* Whether to respect .gitignore and .geminiignore patterns (optional, defaults to true)
* Whether to respect .gitignore and .qwenignore patterns (optional, defaults to true)
*/
file_filtering_options?: {
respect_git_ignore?: boolean;
@@ -297,7 +297,7 @@ export class LSTool extends BaseDeclarativeTool<LSToolParams, ToolResult> {
},
file_filtering_options: {
description:
'Optional: Whether to respect ignore patterns from .gitignore or .geminiignore',
'Optional: Whether to respect ignore patterns from .gitignore or .qwenignore',
type: 'object',
properties: {
respect_git_ignore: {
@@ -307,7 +307,7 @@ export class LSTool extends BaseDeclarativeTool<LSToolParams, ToolResult> {
},
respect_gemini_ignore: {
description:
'Optional: Whether to respect .geminiignore patterns when listing files. Defaults to true.',
'Optional: Whether to respect .qwenignore patterns when listing files. Defaults to true.',
type: 'boolean',
},
},

View File

@@ -409,21 +409,21 @@ describe('ReadFileTool', () => {
);
});
describe('with .geminiignore', () => {
describe('with .qwenignore', () => {
beforeEach(async () => {
await fsp.writeFile(
path.join(tempRootDir, '.geminiignore'),
path.join(tempRootDir, '.qwenignore'),
['foo.*', 'ignored/'].join('\n'),
);
});
it('should throw error if path is ignored by a .geminiignore pattern', async () => {
it('should throw error if path is ignored by a .qwenignore pattern', async () => {
const ignoredFilePath = path.join(tempRootDir, 'foo.bar');
await fsp.writeFile(ignoredFilePath, 'content', 'utf-8');
const params: ReadFileToolParams = {
absolute_path: ignoredFilePath,
};
const expectedError = `File path '${ignoredFilePath}' is ignored by .geminiignore pattern(s).`;
const expectedError = `File path '${ignoredFilePath}' is ignored by .qwenignore pattern(s).`;
expect(() => tool.build(params)).toThrow(expectedError);
});
@@ -435,7 +435,7 @@ describe('ReadFileTool', () => {
const params: ReadFileToolParams = {
absolute_path: ignoredFilePath,
};
const expectedError = `File path '${ignoredFilePath}' is ignored by .geminiignore pattern(s).`;
const expectedError = `File path '${ignoredFilePath}' is ignored by .qwenignore pattern(s).`;
expect(() => tool.build(params)).toThrow(expectedError);
});

View File

@@ -194,7 +194,7 @@ export class ReadFileTool extends BaseDeclarativeTool<
const fileService = this.config.getFileService();
if (fileService.shouldGeminiIgnoreFile(params.absolute_path)) {
return `File path '${filePath}' is ignored by .geminiignore pattern(s).`;
return `File path '${filePath}' is ignored by .qwenignore pattern(s).`;
}
return null;

View File

@@ -68,7 +68,7 @@ describe('ReadManyFilesTool', () => {
tempDirOutsideRoot = fs.realpathSync(
fs.mkdtempSync(path.join(os.tmpdir(), 'read-many-files-external-')),
);
fs.writeFileSync(path.join(tempRootDir, '.geminiignore'), 'foo.*');
fs.writeFileSync(path.join(tempRootDir, '.qwenignore'), 'foo.*');
const fileService = new FileDiscoveryService(tempRootDir);
const mockConfig = {
getFileService: () => fileService,
@@ -466,7 +466,7 @@ describe('ReadManyFilesTool', () => {
]);
});
it('should return error if path is ignored by a .geminiignore pattern', async () => {
it('should return error if path is ignored by a .qwenignore pattern', async () => {
createFile('foo.bar', '');
createFile('bar.ts', '');
createFile('foo.quux', '');

View File

@@ -65,7 +65,7 @@ export interface ReadManyFilesParams {
useDefaultExcludes?: boolean;
/**
* Whether to respect .gitignore and .geminiignore patterns (optional, defaults to true)
* Whether to respect .gitignore and .qwenignore patterns (optional, defaults to true)
*/
file_filtering_options?: {
respect_git_ignore?: boolean;
@@ -149,13 +149,13 @@ ${finalExclusionPatternsForDescription
: 'none specified'
}`;
// Add a note if .geminiignore patterns contributed to the final list of exclusions
// Add a note if .qwenignore 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)`;
excludeDesc += ` (includes ${geminiPatternsInEffect} from .qwenignore)`;
}
}
@@ -571,7 +571,7 @@ export class ReadManyFilesTool extends BaseDeclarativeTool<
},
file_filtering_options: {
description:
'Whether to respect ignore patterns from .gitignore or .geminiignore',
'Whether to respect ignore patterns from .gitignore or .qwenignore',
type: 'object',
properties: {
respect_git_ignore: {
@@ -581,7 +581,7 @@ export class ReadManyFilesTool extends BaseDeclarativeTool<
},
respect_gemini_ignore: {
description:
'Optional: Whether to respect .geminiignore patterns when listing files. Defaults to true.',
'Optional: Whether to respect .qwenignore patterns when listing files. Defaults to true.',
type: 'boolean',
},
},