@@ -157,7 +157,7 @@ def precheck_for_files(path, files):
157157 return missing_license_list , missing_copyright_list , prj
158158
159159
160- def precheck_for_project (path_to_find , need_log_file ):
160+ def precheck_for_project (path_to_find ):
161161 missing_license = []
162162 missing_copyright = []
163163
@@ -166,18 +166,9 @@ def precheck_for_project(path_to_find, need_log_file):
166166 need_rollback , temp_file_name , temp_dir_name = create_reuse_dep5_file (path_to_find )
167167
168168 try :
169- if need_log_file :
170- # Use ProgressBar
171- timer = TimerThread ()
172- timer .setDaemon (True )
173- timer .start ()
174-
175169 project = Project (path_to_find )
176170 report = ProjectReport .generate (project )
177171
178- if need_log_file :
179- timer .stop = True
180-
181172 # File list that missing license text
182173 missing_license = [str (sub ) for sub in set (report .files_without_licenses )]
183174 if not path_to_find .endswith ("/" ):
@@ -267,10 +258,18 @@ def run_lint(target_path, disable, output_file_name, format='', need_log_file=Tr
267258 oss_pkg_info = []
268259 _turn_on_default_reuse_config = not disable
269260
261+ if need_log_file :
262+ # Use ProgressBar
263+ timer = TimerThread ()
264+ timer .setDaemon (True )
265+ timer .start ()
266+
270267 if _check_only_file_mode :
271268 license_missing_files , copyright_missing_files , project = precheck_for_files (path_to_find , file_to_check_list )
272269 else :
273- license_missing_files , copyright_missing_files , oss_pkg_info , project , report = precheck_for_project (path_to_find , need_log_file )
270+ license_missing_files , copyright_missing_files , oss_pkg_info , project , report = precheck_for_project (path_to_find )
271+ if need_log_file :
272+ timer .stop = True
274273
275274 result_item = result_for_summary (path_to_find ,
276275 oss_pkg_info ,
0 commit comments