refactor: move is_important function to top level

This commit is contained in:
Paul Gauthier (aider) 2024-08-30 14:35:38 -07:00
parent 3191e85857
commit 496525c6c2

View file

@ -158,14 +158,6 @@ IMPORTANT_FILES = [
]
def filter_important_files(file_paths):
"""
Filter a list of file paths to return only those that are commonly important in codebases.
:param file_paths: List of file paths to check
:return: List of file paths that match important file patterns
"""
def is_important(file_path):
file_name = os.path.basename(file_path)
dir_name = os.path.dirname(file_path)
@ -190,4 +182,12 @@ def filter_important_files(file_paths):
file_path.endswith(f"/{name}") for name in IMPORTANT_FILES
)
def filter_important_files(file_paths):
"""
Filter a list of file paths to return only those that are commonly important in codebases.
:param file_paths: List of file paths to check
:return: List of file paths that match important file patterns
"""
return list(filter(is_important, file_paths))