mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-22 01:37:50 +00:00
fix: change .geminiignore to .qwenignore
This commit is contained in:
@@ -22,9 +22,9 @@ describe('crawler', () => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('should use .geminiignore rules', async () => {
|
||||
it('should use .qwenignore rules', async () => {
|
||||
tmpDir = await createTmpDir({
|
||||
'.geminiignore': 'dist/',
|
||||
'.qwenignore': 'dist/',
|
||||
dist: ['ignored.js'],
|
||||
src: ['not-ignored.js'],
|
||||
});
|
||||
@@ -48,16 +48,16 @@ describe('crawler', () => {
|
||||
expect.arrayContaining([
|
||||
'.',
|
||||
'src/',
|
||||
'.geminiignore',
|
||||
'.qwenignore',
|
||||
'src/not-ignored.js',
|
||||
]),
|
||||
);
|
||||
});
|
||||
|
||||
it('should combine .gitignore and .geminiignore rules', async () => {
|
||||
it('should combine .gitignore and .qwenignore rules', async () => {
|
||||
tmpDir = await createTmpDir({
|
||||
'.gitignore': 'dist/',
|
||||
'.geminiignore': 'build/',
|
||||
'.qwenignore': 'build/',
|
||||
dist: ['ignored-by-git.js'],
|
||||
build: ['ignored-by-gemini.js'],
|
||||
src: ['not-ignored.js'],
|
||||
@@ -82,7 +82,7 @@ describe('crawler', () => {
|
||||
expect.arrayContaining([
|
||||
'.',
|
||||
'src/',
|
||||
'.geminiignore',
|
||||
'.qwenignore',
|
||||
'.gitignore',
|
||||
'src/not-ignored.js',
|
||||
]),
|
||||
|
||||
@@ -17,9 +17,9 @@ describe('FileSearch', () => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('should use .geminiignore rules', async () => {
|
||||
it('should use .qwenignore rules', async () => {
|
||||
tmpDir = await createTmpDir({
|
||||
'.geminiignore': 'dist/',
|
||||
'.qwenignore': 'dist/',
|
||||
dist: ['ignored.js'],
|
||||
src: ['not-ignored.js'],
|
||||
});
|
||||
@@ -38,13 +38,13 @@ describe('FileSearch', () => {
|
||||
await fileSearch.initialize();
|
||||
const results = await fileSearch.search('');
|
||||
|
||||
expect(results).toEqual(['src/', '.geminiignore', 'src/not-ignored.js']);
|
||||
expect(results).toEqual(['src/', '.qwenignore', 'src/not-ignored.js']);
|
||||
});
|
||||
|
||||
it('should combine .gitignore and .geminiignore rules', async () => {
|
||||
it('should combine .gitignore and .qwenignore rules', async () => {
|
||||
tmpDir = await createTmpDir({
|
||||
'.gitignore': 'dist/',
|
||||
'.geminiignore': 'build/',
|
||||
'.qwenignore': 'build/',
|
||||
dist: ['ignored-by-git.js'],
|
||||
build: ['ignored-by-gemini.js'],
|
||||
src: ['not-ignored.js'],
|
||||
@@ -66,7 +66,7 @@ describe('FileSearch', () => {
|
||||
|
||||
expect(results).toEqual([
|
||||
'src/',
|
||||
'.geminiignore',
|
||||
'.qwenignore',
|
||||
'.gitignore',
|
||||
'src/not-ignored.js',
|
||||
]);
|
||||
|
||||
@@ -89,9 +89,9 @@ describe('loadIgnoreRules', () => {
|
||||
expect(fileFilter('test.txt')).toBe(false);
|
||||
});
|
||||
|
||||
it('should load rules from .geminiignore', async () => {
|
||||
it('should load rules from .qwenignore', async () => {
|
||||
tmpDir = await createTmpDir({
|
||||
'.geminiignore': '*.log',
|
||||
'.qwenignore': '*.log',
|
||||
});
|
||||
const ignore = loadIgnoreRules({
|
||||
projectRoot: tmpDir,
|
||||
@@ -104,10 +104,10 @@ describe('loadIgnoreRules', () => {
|
||||
expect(fileFilter('test.txt')).toBe(false);
|
||||
});
|
||||
|
||||
it('should combine rules from .gitignore and .geminiignore', async () => {
|
||||
it('should combine rules from .gitignore and .qwenignore', async () => {
|
||||
tmpDir = await createTmpDir({
|
||||
'.gitignore': '*.log',
|
||||
'.geminiignore': '*.txt',
|
||||
'.qwenignore': '*.txt',
|
||||
});
|
||||
const ignore = loadIgnoreRules({
|
||||
projectRoot: tmpDir,
|
||||
|
||||
@@ -28,7 +28,7 @@ export function loadIgnoreRules(options: LoadIgnoreRulesOptions): Ignore {
|
||||
}
|
||||
|
||||
if (options.useGeminiignore) {
|
||||
const geminiignorePath = path.join(options.projectRoot, '.geminiignore');
|
||||
const geminiignorePath = path.join(options.projectRoot, '.qwenignore');
|
||||
if (fs.existsSync(geminiignorePath)) {
|
||||
ignorer.add(fs.readFileSync(geminiignorePath, 'utf8'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user