fix: improve important file matching in is_important function

This commit is contained in:
Paul Gauthier (aider) 2024-08-30 14:45:02 -07:00
parent 648d46fdb3
commit 5532893ac9

View file

@ -231,7 +231,8 @@ def is_important(file_path):
# Check if the file_path matches any of the NORMALIZED_IMPORTANT_FILES
normalized_path = os.path.normpath(file_path)
return any(
normalized_path.endswith(important_file) for important_file in NORMALIZED_IMPORTANT_FILES
normalized_path == important_file or normalized_path.endswith(os.sep + important_file)
for important_file in NORMALIZED_IMPORTANT_FILES
)