diff --git a/pyproject.toml b/pyproject.toml index e7ab936..15d5e75 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ packages=["ragdaemon"] [project] name = "ragdaemon" -version = "0.7.3" +version = "0.7.4" description = "Generate and render a call graph for a Python project." readme = "README.md" dependencies = [ diff --git a/ragdaemon/__init__.py b/ragdaemon/__init__.py index 4910b9e..ed9d4d8 100644 --- a/ragdaemon/__init__.py +++ b/ragdaemon/__init__.py @@ -1 +1 @@ -__version__ = "0.7.3" +__version__ = "0.7.4" diff --git a/ragdaemon/annotators/hierarchy.py b/ragdaemon/annotators/hierarchy.py index b32cb22..661953c 100644 --- a/ragdaemon/annotators/hierarchy.py +++ b/ragdaemon/annotators/hierarchy.py @@ -73,10 +73,12 @@ async def annotate( for dir in directories: dir_str = dir.as_posix() dir_path = dir if dir != Path("ROOT") else Path(".") - document = get_document(dir_str, cwd, type="directory") + document = get_document( + dir_str, cwd, type="directory", ignore_patterns=self.ignore_patterns + ) checksum = hash_str( "".join( - checksums[dir_path / subpath] + checksums.get(dir_path / subpath, "") for subpath in document.split("\n")[1:] ) ) diff --git a/ragdaemon/utils.py b/ragdaemon/utils.py index 7fda850..25960fc 100644 --- a/ragdaemon/utils.py +++ b/ragdaemon/utils.py @@ -95,7 +95,9 @@ def parse_diff_id(id: str) -> tuple[str, Path | None, set[int] | None]: return diff_ref, path, lines -def get_document(ref: str, cwd: Path, type: str = "file") -> str: +def get_document( + ref: str, cwd: Path, type: str = "file", ignore_patterns: set[Path] = set() +) -> str: if type == "diff": if ":" in ref: diff_ref, lines_ref = ref.split(":", 1) @@ -113,7 +115,12 @@ def get_document(ref: str, cwd: Path, type: str = "file") -> str: elif type == "directory": path = cwd if ref == "ROOT" else cwd / ref - paths = sorted([p.as_posix() for p in get_paths_for_directory(path)]) + paths = sorted( + [ + p.as_posix() + for p in get_paths_for_directory(path, exclude_patterns=ignore_patterns) + ] + ) text = "\n".join(paths) elif type in {"file", "chunk"}: