AI Update: اقدامات پیشنهادی رو انجام بده

This commit is contained in:
Antigravity Bot
2026-08-30 19:04:49 +03:30
parent b1b00e142e
commit 7a26378a09
3 changed files with 33 additions and 20 deletions
+16 -9
View File
@@ -52,6 +52,10 @@ DEFAULT_FTP_EXCLUDES = [
"env",
"env/*",
# Dependencies & local packages
"node_modules",
"node_modules/*",
# Logs & temp files
"*.log",
"tmp",
@@ -77,22 +81,25 @@ def should_exclude(rel_path: str, custom_excludes: Optional[List[str]] = None) -
"""Checks if a relative path matches any exclusion pattern."""
excludes = DEFAULT_FTP_EXCLUDES + (custom_excludes or [])
norm_path = rel_path.replace("\\", "/").strip("/")
parts = norm_path.split("/")
parts = [p for p in norm_path.split("/") if p]
for pattern in excludes:
pat = pattern.replace("\\", "/").strip("/")
# Check against full relative path
if fnmatch.fnmatch(norm_path, pat):
return True
# Check against individual directory / file parts
for part in parts:
if fnmatch.fnmatch(part, pat):
return True
# If pattern is a directory (e.g. .git/* or .git), match if path starts with it
clean_pat = pat.rstrip("/*")
# Check against full relative path
if fnmatch.fnmatch(norm_path, pat) or fnmatch.fnmatch(norm_path, clean_pat):
return True
# If path starts with directory pattern
if norm_path == clean_pat or norm_path.startswith(clean_pat + "/"):
return True
# Check against individual directory / file parts
for part in parts:
if fnmatch.fnmatch(part, pat) or fnmatch.fnmatch(part, clean_pat):
return True
return False
+6
View File
@@ -1,6 +1,7 @@
import os
import sys
import json
import html
import logging
import asyncio
import urllib.request
@@ -12,6 +13,11 @@ from config import settings
logger = logging.getLogger("AGYGitManager")
def escape_html(text: str) -> str:
if not text:
return ""
return html.escape(str(text), quote=False)
DEFAULT_GITIGNORE = """# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
File diff suppressed because one or more lines are too long