Files
konabot/scripts/watch_filter.py
passthem 8f5061ba41
All checks were successful
continuous-integration/drone/push Build is passing
wolfx api
2026-03-10 11:39:41 +08:00

34 lines
1.0 KiB
Python

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").absolute()):
return False
if Path(path).absolute().is_relative_to((base / ".git").absolute()):
return False
if (
Path(path)
.absolute()
.is_relative_to((base / "assets" / "oracle" / "image").absolute())
):
# 还要解决坏枪的这个问题
return False
if Path(path).absolute().is_relative_to((base / "htmlcov").absolute()):
return False
if Path(path).absolute().is_relative_to((base / "test").absolute()):
return False
if Path(path).absolute().is_relative_to((base / ".pytest_cache").absolute()):
return False
if Path(path).absolute().is_relative_to((base / ".ruff_cache").absolute()):
return False
if path.endswith(".coverage"):
return False
print(path)
return True