mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-23 13:54:59 +00:00
refactor: make is_important function portable for Windows compatibility
This commit is contained in:
parent
d67872a326
commit
7801aa8cfd
1 changed files with 3 additions and 3 deletions
|
@ -190,7 +190,7 @@ def is_important(file_path):
|
||||||
dir_name = os.path.dirname(file_path)
|
dir_name = os.path.dirname(file_path)
|
||||||
|
|
||||||
# Check for GitHub Actions workflow files
|
# Check for GitHub Actions workflow files
|
||||||
if dir_name.endswith(".github/workflows") and file_name.endswith(".yml"):
|
if os.path.basename(dir_name) == "workflows" and os.path.basename(os.path.dirname(dir_name)) == ".github" and file_name.endswith(".yml"):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# Check for IDE-specific directories
|
# Check for IDE-specific directories
|
||||||
|
@ -198,7 +198,7 @@ def is_important(file_path):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# Check for Kubernetes config files
|
# Check for Kubernetes config files
|
||||||
if "kubernetes" in dir_name.split(os.path.sep) and file_name.endswith(".yaml"):
|
if "kubernetes" in os.path.normpath(dir_name).split(os.sep) and file_name.endswith(".yaml"):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# Check for migration directories
|
# Check for migration directories
|
||||||
|
@ -206,7 +206,7 @@ def is_important(file_path):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return file_name in IMPORTANT_FILES or any(
|
return file_name in IMPORTANT_FILES or any(
|
||||||
file_path.endswith(f"/{name}") for name in IMPORTANT_FILES
|
file_path.endswith(os.path.join('', name)) for name in IMPORTANT_FILES
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue