@@ -35,7 +35,7 @@ def load_ignore_matcher(directory: str) -> PathMatcher:
3535 if not os .path .exists (ignore_path ):
3636 return lambda path : False
3737
38- with open (ignore_path , "r" , encoding = "utf-8" ) as f :
38+ with open (ignore_path , encoding = "utf-8" ) as f :
3939 patterns = f .readlines ()
4040
4141 spec = PathSpec .from_lines ("gitwildmatch" , patterns )
@@ -102,7 +102,7 @@ def read_text_content(file_path: str) -> str:
102102 Returns:
103103 Formatted text content.
104104 """
105- with open (file_path , "r" , encoding = "utf-8" ) as f :
105+ with open (file_path , encoding = "utf-8" ) as f :
106106 return "" .join (" " + line for line in f )
107107
108108
@@ -212,29 +212,31 @@ def pack(
212212 package_name = get_package_name (directory )
213213
214214 all_files = [
215- ( os .path .join (root , file ), root , file )
215+ os .path .join (root , file )
216216 for root , _ , files in os .walk (directory )
217217 for file in files
218218 if not ignore_matcher (os .path .join (root , file ))
219219 ]
220220
221221 if not quiet :
222222 print_action ("Packing" , package_name )
223- for file_path , root , file in all_files :
223+ for file_path in all_files :
224224 rel_path = os .path .relpath (file_path , directory )
225225 print_sub_action ("Reading" , rel_path , path_type = "source" )
226226 if content := process_single_file (
227227 file_path , directory , package_name , ignore_matcher
228228 ):
229229 out .write (content )
230230 else :
231- for file_path , _ , _ in all_files :
231+ for file_path in all_files :
232232 if content := process_single_file (
233233 file_path , directory , package_name , ignore_matcher
234234 ):
235235 out .write (content )
236236
237237 if not quiet :
238238 print_success (
239- f"Packed { format_count (len (abs_dirs ))} packages into { format_path (abs_output , path_type = 'target' )} "
239+ "Packed "
240+ f"{ format_count (len (abs_dirs ))} packages into "
241+ f"{ format_path (abs_output , path_type = 'target' )} "
240242 )
0 commit comments