Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/codegen/git/utils/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ def _determine_language_by_git_file_count(folder_path: str) -> ProgrammingLangua
repo_operator = RepoOperator(repo_config=repo_config)

# Walk through the directory
for rel_path, _ in repo_operator.iter_files(subdirs=[base_path] if base_path else None, ignore_list=GLOBAL_FILE_IGNORE_LIST):
for rel_path, _ in repo_operator.iter_files(
subdirs=[base_path] if base_path else None,
ignore_list=GLOBAL_FILE_IGNORE_LIST,
skip_content=True,
):
# Convert to Path object
file_path = Path(git_root) / Path(rel_path)

Expand Down
7 changes: 6 additions & 1 deletion src/codegen/sdk/codebase/codebase_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,12 @@ def build_graph(self, repo_operator: RepoOperator) -> None:
# =====[ Add all files to the graph in parallel ]=====
syncs = defaultdict(lambda: [])
if not self.config.disable_file_parse:
for filepath, _ in repo_operator.iter_files(subdirs=self.projects[0].subdirectories, extensions=self.extensions, ignore_list=GLOBAL_FILE_IGNORE_LIST):
for filepath, _ in repo_operator.iter_files(
subdirs=self.projects[0].subdirectories,
extensions=self.extensions,
ignore_list=GLOBAL_FILE_IGNORE_LIST,
skip_content=True,
):
syncs[SyncType.ADD].append(self.to_absolute(filepath))
logger.info(f"> Parsing {len(syncs[SyncType.ADD])} files in {self.projects[0].subdirectories or 'ALL'} subdirectories with {self.extensions} extensions")
self._process_diff_files(syncs, incremental=False)
Expand Down
11 changes: 10 additions & 1 deletion src/codegen/sdk/codebase/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,16 @@ def post_init_validation(codebase: CodebaseType) -> PostInitValidationStatus:
return PostInitValidationStatus.NO_NODES

# Verify the graph has the same number of files as there are in the repo
if len(codebase.files) != len(list(codebase.op.iter_files(codebase.ctx.projects[0].subdirectories, extensions=codebase.ctx.extensions, ignore_list=GLOBAL_FILE_IGNORE_LIST))):
if len(codebase.files) != len(
list(
codebase.op.iter_files(
codebase.ctx.projects[0].subdirectories,
extensions=codebase.ctx.extensions,
ignore_list=GLOBAL_FILE_IGNORE_LIST,
skip_content=True,
)
)
):
return PostInitValidationStatus.MISSING_FILES

# Verify import resolution
Expand Down
1 change: 1 addition & 0 deletions src/codegen/sdk/core/codebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ def files(self, *, extensions: list[str] | Literal["*"] | None = None) -> list[T
for filepath, _ in self._op.iter_files(
extensions=None if extensions == "*" else extensions,
ignore_list=GLOBAL_FILE_IGNORE_LIST,
skip_content=True,
):
files.append(self.get_file(filepath, optional=False))
# Sort files alphabetically
Expand Down