diff --git a/aider/special.py b/aider/special.py index 9be26e28f..c5b88e58b 100644 --- a/aider/special.py +++ b/aider/special.py @@ -190,7 +190,7 @@ def is_important(file_path): dir_name = os.path.dirname(file_path) # 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 # Check for IDE-specific directories @@ -198,7 +198,7 @@ def is_important(file_path): return True # 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 # Check for migration directories @@ -206,7 +206,7 @@ def is_important(file_path): return True 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 )