Skip to content

Commit

Permalink
checks: improved final log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Biscgit committed Nov 20, 2024
1 parent 2c1a882 commit 996a6f7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/check_licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,20 @@ async def check_all_paths():
results = await asyncio.gather(*tasks, return_exceptions=True)

finish_time = time.perf_counter() - start_time
logging.info(f"Validated {len(all_paths)} files within {finish_time:.2f} seconds.")
logging.info(f"Processed {len(all_paths)} files within {finish_time:.2f} seconds.")

if any(isinstance(result, Exception) for result in results):
errors = len([1 for result in results if isinstance(result, Exception)])
logging.error(
f"Checks completed with {errors} errors!\n"
f"Validation completed with {errors} errors!\n"
f"\tPlease ensure the licenses are one of the following: {VALID_LICENSE_IDENTIFIERS}.\n"
f"\tIn case it is a valid license, please contact the Open Data Team."
)
exit(1)

else:
logging.info(
"Checks completed successfully!\n"
f"\tChecked {sum(results)} records within {finish_time:.2f} seconds."
f"Successfully validated {sum(results)} records. No errors found."
)


Expand Down

0 comments on commit 996a6f7

Please sign in to comment.