mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-04 19:55:00 +00:00
refactor: improve portability of is_important function
This commit is contained in:
parent
181375c89d
commit
5172281d7a
1 changed files with 7 additions and 3 deletions
|
@ -209,9 +209,13 @@ def is_important(file_path):
|
||||||
if file_name == "migrations" and os.path.isdir(file_path):
|
if file_name == "migrations" and os.path.isdir(file_path):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return file_name in IMPORTANT_FILES or any(
|
# Check if the file_path matches any of the IMPORTANT_FILES
|
||||||
file_path.endswith(os.path.join("", name)) for name in IMPORTANT_FILES
|
normalized_path = os.path.normpath(file_path)
|
||||||
)
|
for important_file in IMPORTANT_FILES:
|
||||||
|
if normalized_path.endswith(os.path.normpath(important_file)):
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def filter_important_files(file_paths):
|
def filter_important_files(file_paths):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue