Skip to content

Commit 78d0ae5

Browse files
committed
Update ignoredDirectoriesAndFiles to avoid false positives
1 parent a1a9e34 commit 78d0ae5

File tree

3 files changed

+2
-119
lines changed

3 files changed

+2
-119
lines changed

packages/core/src/codewhispererChat/constants.ts

Lines changed: 1 addition & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -59,111 +59,13 @@ export const defaultStreamingResponseTimeoutInMs = 180_000
5959
export const ignoredDirectoriesAndFiles = [
6060
// Dependency directories
6161
'node_modules',
62-
'.venv',
63-
'venv',
64-
'bower_components',
65-
'jspm_packages',
6662
// Build outputs
6763
'dist',
6864
'build',
6965
'out',
70-
'target',
71-
'.gradle',
72-
'.pytest_cache',
73-
'.tox',
74-
'__snapshots__',
75-
// Compiled files
76-
'*.class',
77-
'*.o',
78-
'*.a',
79-
'*.so',
80-
'*.pyc',
81-
'__pycache__',
82-
'*.exe',
83-
'*.dll',
84-
// Package files
85-
'*.jar',
86-
'*.gem',
87-
'*.vsix',
88-
'*.zip',
89-
'*.tar.gz',
90-
'*.rar',
91-
// IDE and editor files
66+
// IDE and editor directories
9267
'.idea/',
9368
'.vscode/',
94-
'*.sublime-*',
95-
'*.swp',
96-
'*.swo',
97-
'.project',
98-
'.classpath',
99-
'*.iml',
100-
// Log files
101-
'*.log',
102-
'logs/',
103-
'npm-debug.log*',
104-
// Coverage and test reports
105-
'coverage/',
106-
'.nyc_output/',
107-
'test-results/',
108-
'.test-reports/',
109-
// Cache directories
110-
'.cache/',
111-
'.sass-cache/',
112-
'.eslintcache',
113-
'.parcel-cache',
114-
// Environment and local configuration
115-
'.env',
116-
'.env.local',
117-
'*.env.*',
118-
'*.local.json',
119-
'*.local.yml',
120-
'config.local.*',
121-
'.npmrc',
122-
'.yarnrc',
123-
'.dockerignore',
12469
// OS specific files
12570
'.DS_Store',
126-
'Thumbs.db',
127-
'desktop.ini',
128-
// Temporary files
129-
'tmp/',
130-
'temp/',
131-
'*.tmp',
132-
'*.bak',
133-
'*.bk',
134-
// Generated documentation
135-
'docs/_build/',
136-
'site/',
137-
'public/',
138-
// Database files
139-
'*.sqlite',
140-
'*.db',
141-
// Secrets and credentials
142-
'*.pem',
143-
'*.key',
144-
'id_rsa',
145-
'id_dsa',
146-
'*.pfx',
147-
'*.p12',
148-
'credentials.json',
149-
'*_credentials.*',
150-
'aws-credentials.*',
151-
'secrets.*',
152-
// Version Control Directories
153-
'.git/',
154-
'.svn/',
155-
'.hg/',
156-
'.bzr/',
157-
// Generated Code
158-
'*.generated.*',
159-
'*.auto.*',
160-
'*.g.*',
161-
// Cloud Provider Specific
162-
'.terraform/',
163-
'.serverless/',
164-
'cdk.out/',
165-
'.aws-sam/',
166-
'.amplify/',
167-
// Mobile Development
168-
'Pods/',
16971
]

packages/core/src/codewhispererChat/tools/tool_index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
},
8484
"listDirectory": {
8585
"name": "listDirectory",
86-
"description": "List the contents of a directory and its subdirectories, it will filter out build and artifacts directories and files such as `node_modules/`, `build/`, `.git/` or `*.log`.\n * Use this tool for discovery, before using more targeted tools like fsRead.\n *Useful to try to understand the file structure before diving deeper into specific files.\n *Can be used to explore the codebase.\n *Results clearly distinguish between files, directories or symlinks with [F], [D] and [L] prefixes.",
86+
"description": "List the contents of a directory and its subdirectories, it will filter out build outputs such as `build/`, `out/` and `dist` and dependency directory such as `node_modules/` and IDE directories such as `.idea/`, `.vscode/`.\n * Use this tool for discovery, before using more targeted tools like fsRead.\n *Useful to try to understand the file structure before diving deeper into specific files.\n *Can be used to explore the codebase.\n *Results clearly distinguish between files, directories or symlinks with [F], [D] and [L] prefixes.",
8787
"inputSchema": {
8888
"type": "object",
8989
"properties": {

packages/core/src/testInteg/shared/utilities/workspaceUtils.test.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,6 @@ describe('workspaceUtils', () => {
595595
describe('shouldIgnoreDirAndFile', function () {
596596
it('handles exact matches', function () {
597597
assert.strictEqual(shouldIgnoreDirAndFile('node_modules', vscode.FileType.Directory), true)
598-
assert.strictEqual(shouldIgnoreDirAndFile('.env', vscode.FileType.File), true)
599598
assert.strictEqual(shouldIgnoreDirAndFile('random_file.txt', vscode.FileType.File), false)
600599
})
601600

@@ -604,24 +603,6 @@ describe('workspaceUtils', () => {
604603
assert.strictEqual(shouldIgnoreDirAndFile('logs', vscode.FileType.Directory), true)
605604
assert.strictEqual(shouldIgnoreDirAndFile('.idea', vscode.FileType.File), false)
606605
})
607-
608-
it('handles wildcard patterns at the start', function () {
609-
assert.strictEqual(shouldIgnoreDirAndFile('example.class', vscode.FileType.File), true)
610-
assert.strictEqual(shouldIgnoreDirAndFile('test.log', vscode.FileType.File), true)
611-
assert.strictEqual(shouldIgnoreDirAndFile('class.example', vscode.FileType.File), false)
612-
})
613-
614-
it('handles wildcard patterns at the end', function () {
615-
assert.strictEqual(shouldIgnoreDirAndFile('npm-debug.log123', vscode.FileType.File), true)
616-
assert.strictEqual(shouldIgnoreDirAndFile('npm-debug.txt', vscode.FileType.File), false)
617-
})
618-
619-
it('handles complex wildcard patterns', function () {
620-
assert.strictEqual(shouldIgnoreDirAndFile('test.env.local', vscode.FileType.File), true)
621-
assert.strictEqual(shouldIgnoreDirAndFile('my_credentials.json', vscode.FileType.File), true)
622-
assert.strictEqual(shouldIgnoreDirAndFile('config.local.json', vscode.FileType.File), true)
623-
assert.strictEqual(shouldIgnoreDirAndFile('random.txt', vscode.FileType.File), false)
624-
})
625606
})
626607

627608
describe('findStringInDirectory', function () {

0 commit comments

Comments
 (0)