为 Watchfiles 添加更可配置的过滤器
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-11-01 12:40:01 +08:00
parent 8780dfec6f
commit 994c1412da
2 changed files with 14 additions and 1 deletions

13
scripts/watch_filter.py Normal file
View File

@ -0,0 +1,13 @@
from pathlib import Path
from watchfiles import Change
base = Path(__file__).parent.parent.absolute()
def filter(change: Change, path: str) -> bool:
if "__pycache__" in path:
return False
if Path(path).absolute().is_relative_to(base / "data"):
return False
return True