@@ -51,9 +51,7 @@ def generate_markdown_table(broken_links: list[BrokenLink]) -> str:
5151 table += "|----------|-------------|-----------|\n "
5252
5353 for link in broken_links :
54- table += (
55- f"| { link .location } | { link .line_nr } | { link .reasoning } |\n "
56- )
54+ table += f"| { link .location } | { link .line_nr } | { link .reasoning } |\n "
5755
5856 return table
5957
@@ -62,7 +60,7 @@ def generate_issue_body(broken_links: list[BrokenLink]) -> str:
6260 markdown_table = generate_markdown_table (broken_links )
6361 return f"""
6462# Broken Links Report.
65- **Last updated: { datetime .now ().strftime (' %d-%m-%Y %H:%M' )} **
63+ **Last updated: { datetime .now ().strftime (" %d-%m-%Y %H:%M" )} **
6664
6765The following broken links were detected in the documentation:
6866{ markdown_table }
@@ -73,7 +71,8 @@ def generate_issue_body(broken_links: list[BrokenLink]) -> str:
7371
7472---
7573This issue will be auto updated regularly if link issues are found.
76- You may close it if you wish, though a new one will be created if link issues are still present.
74+ You may close it if you wish.
75+ Though a new one will be created if link issues are still present.
7776
7877"""
7978
@@ -85,11 +84,11 @@ def strip_ansi_codes(text: str) -> str:
8584
8685
8786if __name__ == "__main__" :
88- argparse = argparse .ArgumentParser (
87+ arg = argparse .ArgumentParser (
8988 description = "Parse broken links from Sphinx log and generate issue body."
9089 )
91- argparse .add_argument ("logfile" , type = str , help = "Path to the Sphinx log file." )
92- args = argparse .parse_args ()
90+ arg .add_argument ("logfile" , type = str , help = "Path to the Sphinx log file." )
91+ args = arg .parse_args ()
9392 with open (args .logfile ) as f :
9493 log_content_raw = f .read ()
9594 log_content = strip_ansi_codes (log_content_raw )
0 commit comments