Skip to content

Commit c3be5c8

Browse files
authored
Add node_modules to GLOBAL_FILE_IGNORE_LIST & Fix "git_most_common" to follow GLOBAL_FILE_IGNORE_LIST (#579)
1 parent 039f6a0 commit c3be5c8

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/codegen/git/repo_operator/repo_operator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ def iter_files(
634634
content = self.get_file(filepath)
635635
yield rel_filepath, content
636636
except Exception as e:
637-
print(f"Error reading file {filepath}: {e}")
637+
logger.warning(f"Error reading file {filepath}: {e}")
638638

639639
def list_files(self, subdirs: list[str] | None = None, extensions: list[str] | None = None) -> list[str]:
640640
"""List files matching subdirs + extensions in a repo.

src/codegen/git/utils/language.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def _determine_language_by_git_file_count(folder_path: str) -> ProgrammingLangua
109109
"""
110110
from codegen.git.repo_operator.repo_operator import RepoOperator
111111
from codegen.git.schemas.repo_config import RepoConfig
112+
from codegen.sdk.codebase.codebase_context import GLOBAL_FILE_IGNORE_LIST
112113
from codegen.sdk.python import PyFile
113114
from codegen.sdk.typescript.file import TSFile
114115

@@ -132,7 +133,7 @@ def _determine_language_by_git_file_count(folder_path: str) -> ProgrammingLangua
132133
repo_operator = RepoOperator(repo_config=repo_config)
133134

134135
# Walk through the directory
135-
for rel_path, _ in repo_operator.iter_files(subdirs=[base_path] if base_path else None):
136+
for rel_path, _ in repo_operator.iter_files(subdirs=[base_path] if base_path else None, ignore_list=GLOBAL_FILE_IGNORE_LIST):
136137
# Convert to Path object
137138
file_path = Path(git_root) / Path(rel_path)
138139

src/codegen/sdk/codebase/codebase_context.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,16 @@
5555

5656

5757
# src/vs/platform/contextview/browser/contextMenuService.ts is ignored as there is a parsing error with tree-sitter
58-
GLOBAL_FILE_IGNORE_LIST = [".git/*", ".yarn/releases/*", ".*/tests/static/chunk-.*.js", ".*/ace/.*.js", "src/vs/platform/contextview/browser/contextMenuService.ts"]
58+
GLOBAL_FILE_IGNORE_LIST = [
59+
".git/*",
60+
"*/.git/*",
61+
"node_modules/*",
62+
"*/node_modules/*",
63+
".yarn/releases/*",
64+
".*/tests/static/chunk-.*.js",
65+
".*/ace/.*.js",
66+
"src/vs/platform/contextview/browser/contextMenuService.ts",
67+
]
5968

6069

6170
@unique

0 commit comments

Comments
 (0)