mirror of
https://github.com/safishamsi/graphify.git
synced 2026-08-28 09:17:02 +00:00
fix: skip Obsidian vault metadata directories
This commit is contained in:
committed by
safishamsi
parent
5ffaaa606a
commit
3c843bd0cc
@@ -808,6 +808,7 @@ _SKIP_DIRS = {
|
||||
".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
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user