Files
project-manager/project_manager/common/ignore.py
T
2026-08-06 01:20:58 +03:00

20 lines
420 B
Python

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)