feat: use .gitignore

This commit is contained in:
2026-08-06 01:20:58 +03:00
parent d062447e6d
commit 9d15380443
13 changed files with 183 additions and 130 deletions
+19
View File
@@ -0,0 +1,19 @@
from pathlib import Path
from pathspec import PathSpec
DEFAULT_IGNORE = [
".git",
"node_modules",
".venv",
"__pycache__",
]
def create_ignore(basepath: Path) -> PathSpec:
lines = DEFAULT_IGNORE.copy()
gitignore = basepath / ".gitignore"
if gitignore.exists():
with open(gitignore, "r") as fd:
lines += fd.readlines()
return PathSpec.from_lines("gitignore", lines)