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
1 change: 1 addition & 0 deletions graphify/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@ def count_words(path: Path) -> int:
".next", ".nuxt", ".turbo", ".angular",
".idea", ".cache", ".parcel-cache", ".svelte-kit", ".terraform", ".serverless",
".graphify", # graphify's own extraction cache — never index self-generated data
".obsidian", ".smart-env", # Obsidian vault metadata and plugin caches (#2493)
".worktrees", # git worktree convention (#947) — sibling checkouts, always redundant
}

Expand Down
19 changes: 19 additions & 0 deletions tests/test_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,25 @@ def test_detect_skips_noise_dot_dirs():
assert noise not in f


def test_detect_skips_obsidian_vault_metadata_dirs(tmp_path):
"""Obsidian metadata and plugin caches are not part of the source corpus (#2493)."""
for directory in (".obsidian", ".smart-env"):
metadata_dir = tmp_path / directory
metadata_dir.mkdir()
(metadata_dir / "state.json").write_text("{}")
trash_dir = tmp_path / ".trash"
trash_dir.mkdir()
(trash_dir / "state.json").write_text("{}")
(tmp_path / "project.json").write_text("{}")

result = detect(tmp_path)

assert result["files"]["code"] == [
str(trash_dir / "state.json"),
str(tmp_path / "project.json"),
]


def test_classify_md_paper_by_signals(tmp_path):
"""A .md file with enough paper signals should classify as PAPER."""
paper = tmp_path / "paper.md"
Expand Down