File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -122,8 +122,6 @@ def load_from_disk(cls, paths: list[Path]) -> list[Self]:
122
122
yaml_files : list [Self ] = []
123
123
file_extensions = {".yaml" , ".yml" , ".json" } # FIXME: .json is not a YAML file, should be removed
124
124
125
- paths = sorted (paths , key = lambda p : p .name ) # Ensure order when processing paths
126
-
127
125
for file_path in paths :
128
126
if not file_path .exists ():
129
127
# Check if the provided path exists, relevant for the first call coming from the user
@@ -135,6 +133,7 @@ def load_from_disk(cls, paths: list[Path]) -> list[Self]:
135
133
elif file_path .is_dir ():
136
134
# Introduce recursion to handle sub-folders
137
135
sub_paths = [Path (sub_file_path ) for sub_file_path in file_path .glob ("*" )]
136
+ sub_paths = sorted (sub_paths , key = lambda p : p .name )
138
137
yaml_files .extend (cls .load_from_disk (paths = sub_paths ))
139
138
# else: skip non-file, non-dir (e.g., symlink...)
140
139
You can’t perform that action at this time.
0 commit comments