mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-20 02:18:13 +00:00
Improved performance of find_all_non_ignored_files by not descending into ignored dirs
This commit is contained in:
1 parent
2909c67d50
commit
25139d1d74
2 files changed
+5
-3
No files matched your search
@@ -76,8 +76,10 @@ def find_all_non_ignored_files(repo_root: str) -> list[str]:
|
||||
:return: A list of all non-ignored files in the repository
|
||||
"""
|
||||
gitignore_parser = GitignoreParser(repo_root)
|
||||
_, files = scan_directory(repo_root, recursive=True)
|
||||
return [file for file in files if not gitignore_parser.should_ignore(file)]
|
||||
_, files = scan_directory(
|
||||
repo_root, recursive=True, is_ignored_dir=gitignore_parser.should_ignore, is_ignored_file=gitignore_parser.should_ignore
|
||||
)
|
||||
return files
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -19,7 +19,7 @@ def iter_subclasses(cls: type[T], recursive: bool = True) -> Generator[type[T],
|
||||
yield from iter_subclasses(subclass, recursive)
|
||||
|
||||
|
||||
def determine_programming_language_composition(repo_path: str, rel_path_to_gitignore: str = ".gitignore") -> dict[str, float]:
|
||||
def determine_programming_language_composition(repo_path: str) -> dict[str, float]:
|
||||
"""
|
||||
Determine the programming language composition of a repository.
|
||||
|
||||
|
||||
Reference in new issue
Block a user